|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need critique of programming idea and info!!!
I am using EasyC
I was thinking of controlling the soleniods in the following manner (and this is psuedocode) Setup info: I have a global button_counter(1) integer that keeps track of how many times a button has been pressed on the joystick, and I have a relay, and I have a button(1) variable that holds input from one of the joystick buttons. The example uses 'button1' and 'button_counter1' but could work for buttons 1 through for 4 to control seperate soleniods or relay attachments. If button(1) is pressed { button_counter1 ++ // turn on relay in one positive direction if button_count == 0 { while (button not pressed again) { set relay1(1,0) } else if button_count == 1 { while (button not pressed again) { set relay1(0,0) } } else if button_count == 2 { while (button not pressed again) { set relay1(0,1) } } else { set relay1(0,0); button_count = 0;} end if end if The purpose being to be able to have the flow controlled for each soleniod by only 1 button being pressed. I don't have access to the robot to know exactly how they work. I'm doing this code from remote location and need help as soon as possible. Let me know if it will work! Please PM me if you have a suggestion. Also, how do I capture the event of a button press? I don't know how to set a listener for an OI digital input that could then be the codition for the original if |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help Programming and wiring camera! | Amisca | Programming | 1 | 14-02-2006 18:37 |
| need scouting info from teams 966 and 970!!!! | jeffwalsh | Scouting | 0 | 05-02-2003 15:48 |
| We NEED 8-inch wheels and programming help | archiver | 2001 | 7 | 24-06-2002 00:29 |
| Need info on how to build temp. receiver and transmitter | archiver | 1999 | 5 | 23-06-2002 22:01 |