![]() |
IR from scratch
I'm one of those programmers who needs to know how everything works in a code to learn. I don't like using code designed by someone else, besides just learning from it. Now, to the point...
Is it possible for me to just put the IR sensor on a digital input on the default code? I've been trying the sensor on a dig i/o. I told it to print the value to the terminal IFI loader screen, but it only equals 1, even when the sensor is not in. Am I doing something wrong? |
Re: IR from scratch
The sensor goes from high to low many times a second with the beacon working properly. You need to "measure" the low times in order to find out which beacon it is. This will also allow you to search for it.
|
Re: IR from scratch
Quote:
|
Re: IR from scratch
One way of doing it is putting it on an interrupt. The robot controller just does not poll digital inputs fast enough to pick up the signal. Another way would require you to design an external circuit with a memory chip on it that would store several bits before being read (and cleared) by the RC. This would be quite complicated to do properly in 3 weeks :) so just go with the interrupts.
|
Re: IR from scratch
Quote:
-Kevin |
Re: IR from scratch
Quote:
|
Re: IR from scratch
Quote:
|
Re: IR from scratch
1 Attachment(s)
Quote:
I have encountered IR remote controls that aren't broadcasting at the 40kHz of the IR sensor, and so don't get detected. Double check your IR sensor hookup. Looking at the from of the IR sensor: pin 1 (on the left) should be your white or signal wire, pin 2 (middle) should be your black or ground wire, pin 3 (on right) should be your red or 5v wire. Try a different IR sensor in case it's bad. Have you verified the operation of your beacon? Here's some code to double check your setup. This code runs everything (beacon included) on the FRC. See the ReadMe for what's connected to what. I setup digital IO pin 6 to do what you're attempting with the IR sensor. You can use this to see if the problem is with the sensor or beacon before you go too crazy. Oops. I mistyped rc_dig_in06. You'll see it when you build. Sorry about that chief. |
| All times are GMT -5. The time now is 09:06. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi