Quote:
|
Originally Posted by dhoizner
If I have code that says (example only)
Will the printf's change when i flip either of the switches? Basically, my question is if code between #ifdef/#endif is loaded onto the robot, and whether or not variables can be defined on the fly, based on switch input.
Thank you in advance,
|
That won't work. #define is a preprocessor directive, i.e. it won't work during run-time. A better thing to do would be to just do this directly:
if(rc_dig_in01==1)
{
printf("Hello, world.\r");
}
else if (rc_dig_in02==1)
{
printf("FIRST Robotics\r");
}
__________________
Tom C.
Software and Controls Mentor
Team 2849
Prior team associations: 1418 ('08-'09), 1100 ('05-'08), 811 ('02, '04-'05), 246 ('03)