if anyone can helpme program tne pneumatics, that’ll be e lot of help. i got no clue
I can’t help you if you’re using EasyC, but if you’re using Microchip’s toolchain, you can program spikes to operate a solenoid and thus control airflow to your cylinders through the relayX global aliases.
For example:
if(p1_sw_trig) { /* port 1 joystick trigger is depressed */
relay1_fwd = 1; /* Output +12V to your solenoid, allowing air flow in one direction*/
relay1_rev = 0; /* No output to -12V */
} else { /* Trigger released */
relay1_fwd = relay1_rev = 0; /* No output, solenoid changes position and flow reverses */
}
Basically, just use the relays to control +12V and -12V to solenoids or pumps or whatever have you. Never put relayX_fwd and relayX_rev both to 1, however. Sorry if I can’t give a better description… I’m totally wiped from last night (got home at 3:45AM after a few disasters…)
In MPLab (all i know), the relays are controlled by default fairly well. here’s the code from default:
relay1_fwd = p1_sw_trig & rc_dig_in01; /* FWD only if switch1 is not closed. */
relay1_rev = p1_sw_top & rc_dig_in02; /* REV only if switch2 is not closed. */
relay2_fwd = p2_sw_trig & rc_dig_in03; /* FWD only if switch3 is not closed. */
relay2_rev = p2_sw_top & rc_dig_in04; /* REV only if switch4 is not closed. */
relay3_fwd = p3_sw_trig;
relay3_rev = p3_sw_top;
relay4_fwd = p4_sw_trig;
relay4_rev = p4_sw_top;
relay5_fwd = p1_sw_aux1;
relay5_rev = p1_sw_aux2;
relay6_fwd = p3_sw_aux1;
relay6_rev = p3_sw_aux2;
relay7_fwd = p4_sw_aux1;
relay7_rev = p4_sw_aux2;
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
relay8_rev = 0;
basically, the first relay is controlled by the trigger and side switch on the first joystick. the second is the same on the second joy, etc. etc., up until the fifth. THose are as follows:
relay 5: Joy 1 top buttons
relay 6: Joy 3 top buttons
relay 7: joy 4 top buttons
here’s the nice one:
relay 8: opposite of 18th input.
Basically, the last one is for the pneumatics. put a pressure switch on the 18 digital input, and the compressor will run automatically! Isn’t technology amazing?