View Single Post
  #7   Spotlight this post!  
Unread 21-01-2008, 23:09
blaxbb blaxbb is offline
Ohio State Engineering Scholar
AKA: Brian Barrett
FRC #2331
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Vernon, New Jersey
Posts: 131
blaxbb is just really niceblaxbb is just really niceblaxbb is just really niceblaxbb is just really niceblaxbb is just really nice
Relays and IR Board

Quote:
Originally Posted by Spartan151 View Post
Okay. Once I get the basics done, I will need help programming the IR board functions, and programming the pneumatics for our claw to the arm joystick. I'll let you know when we get to that stage, but please, feel free to explain ahead of time. It'll help our team get a better understanding so there's no head-scratching later.
This is where the electronics and programming team/person has to work together.

The pneumatic cylinders are piped by solenoids (electronic valves,) which are controlled by a spike (relay.)

Relays don't use the analog 0-254 scale. They are essentially digital outputs that can be either forward, off, or reverse.

You map the relays the same way that you map speed controllers.

Code:
relay1_fwd = p1_sw_trig;
That would set relay1 to be forward every time your joystick 1 trigger is held.

IFI has a list of the joystick inputs here. pdf warning



As far as the IR, you need to read the digital input (1 or 0) and pass it through a conditional (if, else, switch) to execute a command.

Code:
if (rc_dig_in01 == 1) {
     pwm01 = pwm02 = 200;
     }
else {
     pwm01 = pwm02 = 127;
}
change rc_dig_in01 to match up with the digital input that was wired to your bot

the reference docs to wire and train the IR board are here. pdf warning
__________________
"Whether you think you can or think you can’t, you’re right." - Henry Ford
www.vthsrobotics.org