ghostman11
Well-Known Member
i think pommie posted the following code
wich blinks the leds on the june bug at a rate that corresponds to the VR1 on the june bug. the code works fine..however
i been trying to switch this to VR2.
according to the data sheet AN1 is 001, and 101 is AN5??
is not making much sense to me can anyone explain this??
VR2 according to the junebug diagram is on AN3 so how would i set this?
sorry if i havnt described what i want to know very well.
Code:
// Name : BLINK_1.BAS
Device = 18F1320
Clock = 4 // 4MHz clock
Include "junebug.bas"
Dim Count As Byte
Dim GO As ADCON0.1
OSCCON = $62 // select 4MHz internal clock
ADCON1 = %11110101 // digital I/O except RA1 & RA3
ADCON0 = %00000101 //A2D on and select AN1
ADCON2 = %00110101 //Left justify - Fosc/16
While True
Count = 1
While Count < 6
GO = 1 //start conversion
While(GO=1) //wait for it to complete
Wend
LED(Count) // light LED(1..6) or none LED(0)
DelayMS(ADRESh+10) // delay in 1000s of a second
Inc(Count)
Wend
While Count > 1
GO = 1 //start conversion
While(GO=1) //wait for it to complete
Wend
LED(Count) // light LED(1..6) or none LED(0)
DelayMS(ADRESh+100) // delay in 1000s of a second
Dec(Count)
Wend
Wend
End
wich blinks the leds on the june bug at a rate that corresponds to the VR1 on the june bug. the code works fine..however
i been trying to switch this to VR2.
according to the data sheet AN1 is 001, and 101 is AN5??
is not making much sense to me can anyone explain this??
VR2 according to the junebug diagram is on AN3 so how would i set this?
sorry if i havnt described what i want to know very well.