Go to Post Honestly, I'd volunteer my team to be on that alliance. It'd be an honor to touch bumpers with those bots. - ttldomination [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 13-01-2008, 18:01
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
IR programming and wiring difficulties

Hey everyone i have a few questions that i would like to ask.

FIRST of all......i want to make sure that the IR wires should be plugged into the signal pin of the digital input robot controller.
I run easy C and when i run the terminal program on it, it tells me that the robot is sensing the ir sensor but all the inputs are always at one, and then when you press one of the ir buttons it changes the three that aren't being used to zero. Is this what is suppose to happen??

i also haven't been able to get the robot to respond with any of my programs can somebody give me an example program to work with to make this right??? thanks for all the help

Adam (progammer)
  #2   Spotlight this post!  
Unread 13-01-2008, 18:15
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
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,854
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 programming and wiring difficulties

Quote:
Originally Posted by team877 View Post
... all the inputs are always at one, and then when you press one of the ir buttons it changes the three that aren't being used to zero.
This is what you'll see if you power the IR sensor board with a different battery than the one powering your controller. It'll operate fine just the grounds are not common between the two devices as they would be on the robot where both the RC and the IR sensor would both use the same 12v ground.
Is that what you are doing?

You can just program around the all 1's business by checking the pins and only capturing the IR sensor command when three of them drop to zero.

If you are testing the pins one-by-one be careful to take the first non-1 result you get and save that command. Then don't do anything until they all go to 1 again (or all 0's). Otherwise, you could have the pins start to change back while you are testing them and think several of the cmd signals were sent. There are easier/safer ways to handle this in straight C by plugging into digital input pins 15-18 and capturing all the pins simultaneously via (PORTJ>>4).
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 13-01-2008 at 18:55.
  #3   Spotlight this post!  
Unread 13-01-2008, 20:08
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
Re: IR programming and wiring difficulties

i got the 0 thing fixed you were right, but i still can't seem to type in anything that will get the robot to work with the IR sensor
  #4   Spotlight this post!  
Unread 13-01-2008, 23:00
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
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,854
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 programming and wiring difficulties

P.S. For Easy C specific questions post in the Easy C Pro sub forum: http://www.chiefdelphi.com/forums/fo...play.php?f=164

Maybe something simple like this, although I warn you I didn't test this on a robot yet.
Code:
unsigned char IRcmd1;
unsigned char myservo=0;
 
while(1)
{
    IRcmd1 = GetDigitalInput(1);
    if(IRcmd1 !=0)
    {
        myservo++; 
    }
    SetPWM(1,myservo);
}
Plug a servo into PWM1.
Add a backup battery since that's all that power things plugged into the pwm outputs.
The servo should move from one extreme to the other when the correct button is pushed.
You'd have to cycle the power to get it to reset.
Attached Files
File Type: doc testprog.doc (101.5 KB, 49 views)
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 14-01-2008 at 15:29.
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
Programming in Python and Explaination of Programming roboxking Programming 22 07-01-2008 16:08
Need help Programming and wiring camera! Amisca Programming 1 14-02-2006 18:37
I'm having difficulties locating the programming code "gift" Flynn Programming 3 09-01-2005 22:01
Team issues and difficulties?....(not just technical ones) tribotec_ca88 General Forum 40 11-02-2004 10:36
Pneumatics electrical wiring and programming archiver 2001 1 23-06-2002 23:10


All times are GMT -5. The time now is 18:41.

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