View unanswered posts | View active topics It is currently Fri Oct 30, 2020 7:43 pm

Reply to topic  [ 2 posts ] 
What's wrong with this code? 
Author Message

Joined: Fri Sep 18, 2015 1:57 pm
Posts: 1
Post What's wrong with this code?
SensorValue(leftEncoder) = 0;
while(SensorValue(leftEncoder) <= 414)
motor[port2] = 127;
motor[port3] = -127;

**Error**:Undefined variable 'leftEncoder'. 'short' assumed.

Fri Sep 18, 2015 2:04 pm
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Post Re: What's wrong with this code?
The most likely cause of this issue is that the leftEncoder is not defined in the Motors and Sensors setup; double check to make sure that the encoder itself is defined properly, and that the alias you've given it exactly matches the name you are using in your code (in this case, "leftEncoder").

Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.

Fri Sep 18, 2015 3:53 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

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.