1 REM JAN DEROGEE  (2013)
2 REM KILL FC-III BEFORE USE
3 POKE 53281,0:POKE 53280,0
8 SYS 49500:REM ACTIVATE WEDGE (C64)
10 PRINT"{clear}{home}{white}";
11 PRINT"UDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDI"
12 PRINT"G cassiopei adc example{space*6}(jd 2013)H"
13 PRINT"JFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFK"
14 PRINT"UDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDI"
15 PRINT"G{space*10}ch0:{space*7}volt{space*12}H"
16 PRINT"G{space*37}H"
17 PRINT"JFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFK"
20 PRINT"{home}{down*4}{right*16}";:GOSUB 101
40 GOTO 20
!- ------------------------------------------------
!- -                  SUBROUTINES                 -
!- ------------------------------------------------
101 MAX=1023:REM MAX VALUE OF ADC
102 VCC=3.30:REM CASSIOPEI WORKING VOLTAGE
104 BIT=VCC/MAX:REM THE VALUE OF A SINGLE LSB
105 SCALE=(1000+10000)/1000
110 A=!ADC,0:REM MEASURE VOLTAGE
120 U = A * BIT * SCALE
130 PRINT LEFT$(STR$(U),5)
135 B=A/3
150 PRINT"{right}";
160 FOR L=0 TO 36
165 IF L<=B THEN PRINT"{cm i}";
166 IF L>B THEN PRINT" ";
170 NEXT L
190 RETURN