Go to Post oooo can i get bear hugged at monty madness...please big mike, please - Rohith Surampudi [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-02-2004, 17:02
Obi's Avatar
Obi Obi is offline
Registered User
#0870
 
Join Date: Jan 2004
Location: Southold
Posts: 18
Obi is an unknown quantity at this point
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?
__________________
[hr]
Southold Robotics Team #870 (RICE)
  #2   Spotlight this post!  
Unread 03-02-2004, 17:54
Ryan Cumings's Avatar
Ryan Cumings Ryan Cumings is offline
Programmer and University Rejected
#0134 (Team Discovery)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Pembroke, NH
Posts: 65
Ryan Cumings is an unknown quantity at this point
Send a message via AIM to Ryan Cumings
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   Spotlight this post!  
Unread 03-02-2004, 17:55
Obi's Avatar
Obi Obi is offline
Registered User
#0870
 
Join Date: Jan 2004
Location: Southold
Posts: 18
Obi is an unknown quantity at this point
Re: IR from scratch

Quote:
Originally Posted by Ryan Cumings
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.
How do you "measure" the values?
__________________
[hr]
Southold Robotics Team #870 (RICE)
  #4   Spotlight this post!  
Unread 03-02-2004, 18:43
Greg's Avatar
Greg Greg is offline
Registered User
FRC #1075 (Sinclair Sprockets)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2003
Location: Whitby, Ontario, Canada
Posts: 108
Greg is on a distinguished road
Send a message via ICQ to Greg Send a message via MSN to Greg
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   Spotlight this post!  
Unread 03-02-2004, 19:01
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: IR from scratch

Quote:
Originally Posted by Obi
How do you "measure" the values?
Start with the FAQ and then get a copy of the code and start with receiver.c. Once you understand what's going on there, start working on understanding the code in tracker.c. The interface between the two pieces of code is the structure "Sensor_Stats". Once you've mastered that, move on to navigate.c.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #6   Spotlight this post!  
Unread 03-02-2004, 21:27
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,722
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: IR from scratch

Quote:
Originally Posted by Obi
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?
Even on a polled digital input you should be able to see 0's mixed in with the 1's even pointing most IR rmote controls at the sensor. However, as others have noted you won't be able to use this on a competition robot, because you cannot poll it fast enough to follow the beacon sequence of IR flashes.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #7   Spotlight this post!  
Unread 05-02-2004, 16:04
Obi's Avatar
Obi Obi is offline
Registered User
#0870
 
Join Date: Jan 2004
Location: Southold
Posts: 18
Obi is an unknown quantity at this point
Re: IR from scratch

Quote:
Originally Posted by Mark McLeod
Even on a polled digital input you should be able to see 0's mixed in with the 1's even pointing most IR rmote controls at the sensor. However, as others have noted you won't be able to use this on a competition robot, because you cannot poll it fast enough to follow the beacon sequence of IR flashes.
All I get when I print the command to the screen are 1's.
__________________
[hr]
Southold Robotics Team #870 (RICE)
  #8   Spotlight this post!  
Unread 05-02-2004, 16:26
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,722
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: IR from scratch

Quote:
Originally Posted by Obi
All I get when I print the command to the screen are 1's.
Are you using your beacon to generate the IR or something else?
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.
Attached Files
File Type: zip FrcBeaconTracker.zip (60.7 KB, 38 views)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 05-02-2004 at 21:10.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 10:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi