I am using PIC 16f877A
this is the code
DEFINE ADC_BITS 8 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3)
DEFINE ADC_SAMPLEUS 50
ADCON1 = 0 ' PORTA is analog
pw VAR BYTE
TRISA = 255
TRISD = 0
start:
ADCIN 0,pw
if (pw > 220) and (pw<252) then
pulsout portd.3,220
else
goto start
endif
goto start
This program works, when I move Joypad to the right motor move to the coresponding postion, I wanna know what is the right value of variable pw, when my joypad is moved al the way to the right and al the way to the left??
Bookmarks