|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#13
|
||||||
|
||||||
|
Re: A few questions on programming the Control System
Here is how I would implement the code (from which you should be able to figure out how to implement your code with pointers)
Code:
void toggle_single_solenoid(unsigned char button, unsigned char *prev_button, unsigned char *relay_fwd)
{
if (button && !prev_button) //don't keep toggling if they hold the button
*relay_fwd = !(*relay_fwd);
*prev_button = button;
}
Code:
toggle_single_solenoid(p1_sw_trig, &prev_p1_sw_trig, &relay1_fwd); |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What do you wish you knew about the new control system? | Joe Ross | Control System | 2 | 09-01-2004 21:47 |
| Need a FIRST Robotics control system | kershawrobotics | General Forum | 3 | 07-07-2003 09:49 |
| control system worth more than $500 | archiver | 2001 | 8 | 24-06-2002 02:00 |
| control system programming | archiver | 2000 | 17 | 23-06-2002 22:14 |
| Ok, how much is the control system worth? | archiver | 2001 | 6 | 23-06-2002 22:05 |