View unanswered posts | View active topics It is currently Fri May 24, 2019 8:49 pm






Reply to topic  [ 2 posts ] 
encoders in Virtual world Labrynth not working 
Author Message
Rookie

Joined: Fri Jun 20, 2014 8:09 am
Posts: 14
Post encoders in Virtual world Labrynth not working
the Squarebot is not turning. I set it up in Motors and Sensors as the Standard Squarebot ( as I was told to do)
It just goes straight: never turns. I've tried all sorts of encoders numbers and turns using functions even and still goes straight.
I'm using the Curriculum Companion 4.0.0
task main()
{
SensorValue[leftEncoder] = 0;
SensorValue[rightEncoder] = 0;

while(SensorValue[leftEncoder] < 720)
{
motor[leftMotor] = 63;
motor[rightMotor] = 63;
}
wait1Msec(200);

SensorValue[leftEncoder] = 0;
SensorValue[leftEncoder] = 0;

while(SensorValue[leftEncoder] < 720)
{
motor[leftMotor] = 63;
motor[rightMotor] = -63;
}
}
Help
thanks


Sat Jul 12, 2014 12:13 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Jun 11, 2014 9:59 am
Posts: 115
Post Re: encoders in Virtual world Labrynth not working
Sorry for the late response. In ROBOTC 4.0, the Virtual Worlds Robots (specifically your squarebot), uses I2C ports for their encoder ports. In your motors and sensors set up, match the configuration found in the table menu of the Curriculum Companion.


Image Image

Be sure to change your motor type to VEX 269 Motors in order to select the I2C_1 and I2C_2 ports.

For more information please see our tutorial page on our Wiki:
http://www.robotc.net/wiki/Tutorials/Programming_with_the_new_VEX_Integrated_Encoder_Modules#Motors_and_Sensors_Setup

Another thing to note about your code. After configuration is complete, try using the command below to reset and get encoder values.
Code:
nMotorEncoder[nMotor];


Please let me know if this has helped, or if you have anymore questions.


Thu Jul 17, 2014 12:59 pm
Profile
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:  
cron



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