Thanks
Mike
Code: Select all
Device = 18F1220 // Setup the device/clock information
Clock = 8
// some LCD options...
#option LCD_DATA = PORTB.4
#option LCD_RS = PORTB.2
#option LCD_EN = PORTB.3
// uses LCD and AD libraries...
Include "biming_io.bas"
Include "LCD.bas"
Include "convert.bas"
Include "ADC.bas"
Dim
biming_Pot As PORTA.0 // Declare the biming Pot pin
Dim Timing As Word
Function Get_Sample() As float // Function to grab the ADC sample
result = (410 - 256)* 300 / 1024
End Function
ADCON1 = %11101110
//Start Program..
biming = Get_Sample
LCD.MoveCursor (1,1)
LCD.Write(" ", DecToStr(biming), ".", dectostr(biming, 2), " ", "Degees")
End Select
End