I am new to programming and I am ready to turn an LED on/ off on RC1 using a 20K pot on RA1.
I am using a 16F74 PIC and CCS 4.3.0.271.
Here is my code thus far but I'm not sure about the next line.
Code:
void main() {
while(true) {
setup_adc_ports(RA1_ANALOG);
set_adc_channel(1);
delay_us(10);
value = read_adc();
Plz help. I searched tru this forum but to no avail.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sun Mar 21, 2010 3:33 pm
Look at the code in this thread. After you read the A/D value, compare
it to some number. If the A/D value is greater than the specified number,
then turn on the LED.
http://www.ccsinfo.com/forum/viewtopic.php?t=24750
solidust
Joined: 08 Mar 2010 Posts: 13
Posted: Mon Mar 22, 2010 8:57 pm
Thanks man you helped me out alot there. Thanks. Blessings.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum