I have the attached circuit and the following program:
TRISIO=%1 'Pic 12F675
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50
cmcon=7
ansel=1
ADCON0=131
number VAR word
Pause 100
Loop:
ADCIN 0, number ' (0-1023)
IF number > 0 AND number < 400 Then
GPIO.1=1
GPIO.2=0
GPIO.4=0
EndIF
IF number > 401 AND number < 800 Then
GPIO.1=0
GPIO.2=1
GPIO.4=0
EndIF
IF number > 801 AND number < 1024 Then
GPIO.1=0
GPIO.2=0
GPIO.4=1
EndIF
GoTo loop
End
it does not work, any ideas?
Im trying to do my 1st ADC program, a simpler working one that make me understand the concept is welcome too!!!
Thanks a bunch
Bookmarks