RCTIME not getting a result
I decided to make another 'chicken door' again this time using a 16f84. As it has no ADC for the LDR I tried using RCTIME but all I get is either 0 or 1 as the result, is it my code?
I tried putting one end of the LDR to 5v the other to a .1 cap which then goes to the pin.
I tried LDR to pin , other end to cap to ground.
Both give same result.
I'm using:-
LOW PortB.0
PAUSE 10
RCTIME PortB.0,0,LDR
LCDOUT $FE,$80,LDR
Re: RCTIME not getting a result
OK, no-one answered my simple question.
Fortunately a YouTube video answered it although it's in Hungarian I think.
The PBP manual doesn't make it very clear but the video shows that two pins are necessary to use RCTIME ?
One to charge up the cap the other to measure the discharge.
One via a 1k resistor the other via a 1Meg resistor and .1 capacitor.
Re: RCTIME not getting a result
Quote:
shows that two pins are necessary to use RCTIME
No, only one pin is used
Code:
' CAP POT
' +5------||---;---/\/\------ZERO
' |
' |
' PIN-----/\/\--'
' 10K
But you probably will not be happy with the results. Use a MCU with ADC.