goeckerd
Rookie
Joined: Thu Jul 07, 2011 1:34 am Posts: 6
|
 Duplicate config defined names
Why does this not produce an error?
#pragma config(Sensor, in1, Right, sensorReflection) #pragma config(Sensor, in2, Center, sensorReflection) #pragma config(Sensor, in3, Left, sensorReflection) #pragma config(Motor, port1, Right, tmotorVex269_HBridge, openLoop, reversed) #pragma config(Motor, port10, Left, tmotorVex269_HBridge, openLoop)
"Right" and "Left" are defined twice. In this case "Right" happens to be 0 in both cases so it works. However, "Left" is defined as 2 for the sensor but then redefined later as 9 by the motor definition. The "Left" sensor does not work in the code because it points to the wrong port.
|