ROBOTC.net forums
http://robotc.net/forums/

Virtual Worlds works wrong with EV3. How to move straight?
http://robotc.net/forums/viewtopic.php?f=55&t=13673
Page 1 of 1

Author:  Vario [ Sat Mar 19, 2016 5:25 pm ]
Post subject:  Virtual Worlds works wrong with EV3. How to move straight?

I've created simple program to test Ev3 virtual worlds.
As they said in documentation:
Code:
// This makes it go straight (both get equal amount of power)
   // for 1000 encoder counts at power level 50
   setMotorSyncEncoder(left, right, 0, 1000, 50);
   sleep(1500);


But robot doesn't move straight. It turns... I've tried different nTurnRatios? nothing helps..

Code:
#pragma config(Sensor, S1,     touchSensor,    sensorEV3_Touch)
#pragma config(Sensor, S2,     gyroSensor,     sensorEV3_Gyro, modeEV3Gyro_RateAndAngle)
#pragma config(Sensor, S3,     colorSensor,    sensorEV3_Color, modeEV3Color_Color)
#pragma config(Sensor, S4,     sonarSensor,    sensorEV3_Ultrasonic)
#pragma config(Motor,  motorA,          armMotor,      tmotorEV3_Large, PIDControl, encoder)
#pragma config(Motor,  motorB,          leftMotor,     tmotorEV3_Medium, PIDControl, driveLeft, encoder)
#pragma config(Motor,  motorC,          rightMotor,    tmotorEV3_Medium, PIDControl, driveRight, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
   for (;;){
      setMotorSyncEncoder(motorC,motorB, 0, 200,50);
      sleep(500);
   }
}

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/