View Full Version : I need some help with programming the Pneumatics
DPTeam270Driver
01-05-2008, 17:46
Heyy guys
our team has a demo robot that we would like to have pneumatics on.
but we dont know how to program pneumatics in easy-c
if some one could help us and show a sample code to use that would be great
we have 3 pistons hooked up to solenoids and spikes. they are all wired up to the board, but we just need a program to put in. we would like them to fire on buttons
thank you to anyone who can help us
Dave Scheck
01-05-2008, 18:58
I'll let someone else help with the EasyC syntax, but I'll at least give you some insight that might allow you to help yourself.
Think about what you want to do in plain English.
If the port 1 trigger button is pressed, set relay 1 to on...otherwise (else) set relay 1 to off
If the port 1 top button is pressed, set relay 2 to on...otherwise (else) set relay 2 to off
If the port 1 aux1 button is pressed, set relay 3 to on...otherwise (else) set relay 3 to offThere are two values that you can set in order to set the state of a relay, forward and reverse. This table should help you determine what you need to do to get the desired resultFwd = 0 Rev = 0 - OFF (orange)
Fwd = 0 Rev = 1 - Reverse (red)
Fwd = 1 Rev = 0 - Forward (green)
Fwd = 1 Rev = 1 - OFF (orange)
So what blocks in EasyC correspond with the description above? Well, there's probably an If/Else block and there's probably a relay out block. Think through it, and experiment a bit. I'm sure that if you try it you'll figure it out. I would suggest not connecting the outputs of the relays and using the LED on the spike as feedback on whether your code is working or not. This will protect you from accidental misfires.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.