Quote:
Originally Posted by Generalx5
Is it possible to define something and have a set of commands built into it?
|
Yes, it is possible to do that, though what you posted isn't even close to the right syntax.
But don't do it with a
#define. What you're probably looking for is a function that will do what you want.
Code:
void Setting_1(void)
{
solenoid1 = 1;
solenoid2 = 0;
solenoid3 = 1;
solenoid4 = 0;
solenoid5 = 0;
solenoid6 = 0;
}
if (Sensors_are_online)
{
Setting_1();
}
Generalx5, it looks like you could use a beginning tutorial in C syntax. Does anyone here have any suggestions for one?