REM File: ADC_ALL.BAS Date: 01/24/92 REM REM /* (c) Copyright BLUE EARTH RESEARCH, MANKATO, MN 1992. */ REM /* All rights reserved. */ REM REM The following program results in all eight analog inputs being REM continuously sampled. The analog input voltages will be displayed REM on the the screen of the terminal connected to the controller's REM serial port. The program is an infinite loop, and will continue REM until a Ctrl-C is detected. 6 REM ALL CHANNEL ADC PROGRAM 10 ADC=0FF00H REM CONVERT EACH CHANNEL ONCE EACH LOOP 20 FOR C=8 TO 0FH REM INVOKE THE CONVERSION 30 XBY(ADC)=C REM READ THE RESULT AND CONVERT TO A VALUE BETWEEN 0-5 VOLTS 35 B=5*XBY(ADC)/255 REM PRINT THE RESULT ON THE SCREEN 40 PRINT USING(#.##),B, 50 NEXT C REM RESTORE THE CURSOR TO THE BEGINNING OF THE LINE AND LOOP 60 PRINT CR, 70 GOTO 20