Quote:
|
Originally Posted by Lord Nerdlinger
Right now we have our pump hooked up to one of the spikes on #5 and while it works (press a button and it goes on) it doesn't stay on and it's really annoying to have to hold it down.
I think* (i don't know how to code and no one on the team does) that all I have to do is something like this
when joystick button is depressed set a variable equal to one
then do an if statement, if variable equals 1 to set the relay to fwd, else if, set relay to neutral position i guess fwd and rev are equal to zero?
I don't know the proper syntax or way about doing this, but i think it would only be a 1 or 2 lines of code
could anyone tell me how to do it or write it out so I could just copy and paste it into our code? plzzzz
It's #5 if you want to write it out
|
This isn't what you're looking for, but you may like this, use it, and even learn from it. In the default code, if you hook up the compressor to relay 8, and hook up your preassure switch( that came with your kit ) to digital in 18, whenever the preasure is below 95, it will pump untill it gets to 115 (or somewhere around there). What happens is this:
relay8rev = !digitalinput18;
those names area ll wrong because I dont have code with me, but what it does is set the relay to the opposite value of the digital input sensor (in this case, the preasure switch). If the swith is 1 (it's up to preasure) the relay is off. If it's below presure (0), then the relay will fire up (to 1). Hope you can learn something from this.
~Bstempi