Quote:
Originally Posted by Spartan151
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