![robotc if else robotc if else](http://jschoolcraft.github.io/robotc-programming-tutorial/images/ch96/ROBOTC_Code_Formatting_Format_Whole_File.png)
The code generated by the preprocessor is saving you from writing a lot of setup code yourself, but it is also making some normal-looking variables do some unexpected things. The preprocessor is why you have access to the motor array (which you didn't need to declare before using), and why assigning a value to a motor causes your real-world motors to move (which does not happen when assigning to a "normal" variable). In other words, there is a hidden step - preprocessing - between the code you wrote and the code that the compiler sees. The #pragma config( ) is actually doing a lot of heavy lifting for you because it is a " preprocessor directive".
![robotc if else robotc if else](https://slidetodoc.com/presentation_image/1e0113358a8b748b0540ffbd20d4bfbc/image-2.jpg)
I think I see where you're confused, and you're correct in noticing that the motor variables are a little different than regular variables. It's hard to guess what it is you are trying to actually do
![robotc if else robotc if else](https://kb.vex.com/hc/article_attachments/360042389831/5dc341389797a.png)
Motor = 20 // will actually move light_green since testThing function changed its value #pragma config(Motor, motorB, light_green, tmotorNXT, PIDControl, encoder) If i was to look at your code, and accept its functionality as literal then the following would work #pragma config(Motor, motorA, light_blue, tmotorNXT, PIDControl, encoder) The old definitions are temporarily maintained here as well until the new implementation is confirmed So they are automatically configured by the compiler which has better utilities for managing and circuit board type has its own set of "enum names" and it was becoming too hard to manage them in the actual 'enum' values for 'tMotor' are automatically defined by the ROBOTC compiler. The actual type of a tmotor is an enum (and used like an int) and the definition can be found in RobotCintrinsics.c included with the product. Your code is very close something like this would work fine #pragma config(Motor, motorA, light_blue, tmotorNXT, PIDControl, encoder) The #pragma is more like a #define in terms of names, as opposed to a variable declaration.