View unanswered posts | View active topics It is currently Sat Sep 26, 2020 3:28 pm

Reply to topic  [ 1 post ] 
Duplicate config defined names 
Author Message

Joined: Thu Jul 07, 2011 1:34 am
Posts: 6
Post 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.

Wed May 17, 2017 1:56 pm
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.