LCD
A/D
- lcd_read_AD0.bas
AllDigital
ADCON1 = 0x0e
'this assumes the HD44780 LCD is connected to
' port B as in the EVA board - all LCD defaults assumed
Lcdinit ' no curser showing
Dim an0 As Word 'the value of the analogue input
loop:
Adcin 0, an0 ' measure volts on pin RA0 as (an0 goes 0 - 1023)
Lcdcmdout LcdClear
Lcdout "Analog input AN0" ' top line of LCD
Lcdcmdout LcdLine2Home
Lcdout "Value: ", #an0
WaitMs 250
Goto loop
|