|
Re: Autonomous Help
Think of a light switch, it either emits light or it doesn't. That's how programming digital outputs are. You can turn a light switch on by flipping it up lets say, right? Now lets give the on position (state) of the light the value 1, and when it's off its zero.
rc_dig_out01
rc_dig_out02
rc_dig_out03...
rc_dig_out16 are all variables that act like these switch, but if you are going to use one of these, you must set the corresponding IO pin to Input or output
to use rc_dig_out01
do
IO(x) : x (pin)
IO1= OUTPUT; // so you can OUTPUT data using rc_dig_out01
Remember to put OUTPUT/INPUT declarations in the initialization or whereever all of the OTHER similar statements are.
void Process_Data_From_Master_uP(void)
{
Getdata(&rxdata); /* Get fresh data from the master microprocessor. */
/*... then somewhere in here you can do check statements and set statements */
rc_dig_out01 = 1; // This will turn on output 1,
Putdata(&txdata);
}
// To use this on the actual controller, there are three pins, you would simply hook up a LED (it's a diode so it only goes one way remember) to ground and signal, that would turn on an LED. If your utterly confused, this should help a little, if you can get this working then read some sample code, that's always a good way to go.
GPS (Ground Positive Signal)
1XoX
2ooo
3ooo
__________________
R
|