I have built a motor encoder using an IR LED and a phototransistor. The circuit seems pretty straightforward to me.
With the output of the LED shining directly into the phototransistor (on the breadbord - in reality the light will reflect off black/white encoding disc) the output as measured by my cheapo multimeter is 5.1 volts (same as the source voltage). Yet, when I route that same output to my PICAXE test board, I can't get it to raise an input pin high. What am I missing?
Here's my code:
main:
if pinc.6 = 1 then
high 4
else
low 4
endif
pause 500
goto main
If I force pinc.6 high then, of course 4 goes high.
I am using a PICAXE 20X2
With the output of the LED shining directly into the phototransistor (on the breadbord - in reality the light will reflect off black/white encoding disc) the output as measured by my cheapo multimeter is 5.1 volts (same as the source voltage). Yet, when I route that same output to my PICAXE test board, I can't get it to raise an input pin high. What am I missing?
Here's my code:
main:
if pinc.6 = 1 then
high 4
else
low 4
endif
pause 500
goto main
If I force pinc.6 high then, of course 4 goes high.
I am using a PICAXE 20X2
Attachments
-
10.1 KB Views: 35
Last edited: