I am trying to implement a counter using a PIC16F877A
I have a proximity sensor which will only output high when an object is within a certain range (I have set this range in the pic based on the output voltage of the rangefinder)
I have a variable (double) x, which I set to increment every time the conditions are met. After I reach 5, I then wish for an LED to turn on. I tried this, but the LED is always on...and sometimes flickers.....any idea what the issue is?
Thanks
I have a proximity sensor which will only output high when an object is within a certain range (I have set this range in the pic based on the output voltage of the rangefinder)
I have a variable (double) x, which I set to increment every time the conditions are met. After I reach 5, I then wish for an LED to turn on. I tried this, but the LED is always on...and sometimes flickers.....any idea what the issue is?
Thanks