![]() |
Re: A few questions on programming the Control System
Quote:
|
Re: A few questions on programming the Control System
Quote:
|
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)Code:
toggle_single_solenoid(p1_sw_trig, &prev_p1_sw_trig, &relay1_fwd); |
Re: A few questions on programming the Control System
I haven't tried it, but can you have a pointer to a bit field? relay1_fwd is a macro with the value LATDbits.LATD0. Just curious.
|
Re: A few questions on programming the Control System
What exactly is prev_button?
And thanks...I've been at this for too long... Shouldn't take me this long! |
Re: A few questions on programming the Control System
Alright, I finally figured it out! Here is how I did it.
Code:
if (p1_sw_trig && rel1==0)rel1 and rel2 are simply declared as ints, where rel1 is initialized to 0, and rel2 to 1. This makes it go forward at first, then backwards the next time. |
Re: A few questions on programming the Control System
Quote:
|
| All times are GMT -5. The time now is 02:16. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi