I am trying to work with the IR commands and have not much luck. Nothing seems to work. Can anybody shed some light into it? Here is some code I have been using. To try the IR Input, I used a standard Sony remote as the transmitter, because the IR diode does not seem to work. (No pulses on the scope) There is no output from the Terminal program at all. If I add a DEBUG statement to the code, nothing happens, and the Debug window states that it is "Waiting". Waiting for what and how do I get it to RUN? The scope tells me that I am receiving pulses on A.O. when I use the remote. Using the PULSIN statement does not indicate anything either.
Anybody has any suggestions how to get this working? I am looking to use the IR system for a simple obstacle avoidance Robot.
Anybody has any suggestions how to get this working? I am looking to use the IR system for a simple obstacle avoidance Robot.
Code:
'using the 28X2
'IR diode connected to C.0 directly with a 330 ohm in series to ground.
'IR detector with 3K9 ohm to VCC, connected to A.0
'VCC = 3X AA batteries = 4.5V Nominal
main:
irout C.0,1,1
irin A.0,b4 'check for IR input
pulsin A.0,0,w1 'anything there?
sertxd ("B4 = ",#b4," ,W1 = ",#w1)
sertxd (CR,LF)
pause 800
goto main
Last edited: