|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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? |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
||||
|
||||
|
Re: IR from scratch
Quote:
|
|
#4
|
||||
|
||||
|
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. |
|
#5
|
||||
|
||||
|
Re: IR from scratch
Quote:
-Kevin |
|
#6
|
|||||
|
|||||
|
Re: IR from scratch
Quote:
|
|
#7
|
||||
|
||||
|
Re: IR from scratch
Quote:
|
|
#8
|
|||||
|
|||||
|
Re: IR from scratch
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. Last edited by Mark McLeod : 05-02-2004 at 21:10. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Buckeye Webcast | soap108 | Regional Competitions | 7 | 07-03-2003 10:44 |
| Thoughts...King of the Hill | Justin | Rules/Strategy | 32 | 16-01-2003 11:15 |
| Who had the coolest wheels? | Greg Perkins | General Forum | 24 | 05-05-2002 23:59 |
| Shop from scratch | Keithicus | Technical Discussion | 4 | 18-01-2002 16:04 |
| 2001 Scratch Awards | Andy Grady | General Forum | 12 | 04-10-2001 22:04 |