|Duplicate config defined names
|Page 1 of 1|
|Author:||goeckerd [ Wed May 17, 2017 1:56 pm ]|
|Post subject:||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.
|Page 1 of 1||All times are UTC - 5 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group