|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Programming 2 buttons for a relay
We've worked a couple of examples demonstrating programming joystick buttons for different robot functions.
Joystick Button Control (Using a Functional Global Variable) |
|
#2
|
|||
|
|||
|
Re: Programming 2 buttons for a relay
Hi, Here is some code that avoids using case statements since it seemed overkill. We ran into the problem in which the red light would appear to be blinking at a fast rate and flickering. We resolved this issue by ensuring that a relay command is given only once during each execution. We did this by using select blocks. The true and false signals are enum constants in which I just copied from the relay set vi (right click on the input for the relay set vi and create as constant then make multiple copies of that to put as inputs to the select blocks). For our code, we set one button for forward and another for reverse. When either both or none of the buttons are pressed, the relay defaults to the off state. We are actually controlling two relays with the same control signals so you will see two relay set vis, just ignore the second one. I attached a picture.
This was a little too much but for forward and reverse we created boolean equations that are represented by the logical ands and ors that you see in the code. I really hope this helps! If you have further questions feel free to ask! |
|
#3
|
|||
|
|||
|
Hello, Im having some issues with something similar to this. I have 2 relays connected to window motors that are controling the arm movement. They are already inverse from eachother so i dont have to invert it on the code. What im having trouble with is im using the Y-axis on the joystick to control it, and when i push it forward, it works, but if i pull it back, it wont go back.
i really need help with this. i keep looking over the code and it seems logical, i guess is some minor detail. I would Post a pictrue of the code but im not able to at the moment. This would help me so much if i could get an example. Team 3518 will greatly apreciate the service. |
|
#4
|
|||||
|
|||||
|
Re: Programming 2 buttons for a relay
Quote:
If you aren't trying to wire a joystick to a relay with nothing between them, never mind. I'll have to see your code to give any useful advice. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming a relay in C++ | Kage | C/C++ | 2 | 10-01-2009 17:51 |
| Programming a single relay to two buttons in easyC Pro? | Gizmo2417 | Programming | 1 | 17-02-2008 17:10 |
| Help Programming Buttons | LordFrz | Programming | 3 | 14-02-2008 13:55 |
| Easy C Relay Programming | Team_486 | Programming | 1 | 26-03-2007 15:01 |
| Relay Programming Questions... | comwiz7 | Programming | 11 | 21-02-2006 13:04 |