task main() { TextOut(0, LCD_LINE1, "Starting in 2s"); Wait(2000); while(true){ //TextOut(0, LCD_LINE1, "Rotate 45 +"); RotateMotor(OUT_A, 75, 45); //TextOut(0, LCD_LINE1, "Rotate 45 -"); RotateMotor(OUT_A, -75, 45); //TextOut(0, LCD_LINE1, "Rotate 360 + x2"); RotateMotor(OUT_A, 75, 360); RotateMotor(OUT_A, 75, 360); //TextOut(0, LCD_LINE1, "Rotate 180 -"); RotateMotor(OUT_A, -75, 180); //TextOut(0, LCD_LINE1, "Try Exact 90+"); //NumOut(0, LCD_LINE2, MotorTachoCount(OUT_A)); ResetTachoCount(OUT_A); //NumOut(0, LCD_LINE3, MotorTachoCount(OUT_A)); OnFwd(OUT_A, 100); int degrees = 0; int expected = 360; int diff = 0; int lastReading = 0; while(degrees < expected - diff) { degrees=MotorTachoCount(OUT_A); diff = degrees - lastReading; lastReading = degrees; //NumOut(0, LCD_LINE4, diff); //NumOut(0, LCD_LINE5, degrees); } Off(OUT_A); //NumOut(0, LCD_LINE6, MotorTachoCount(OUT_A)); //Wait(1000); //NumOut(0, LCD_LINE7, MotorTachoCount(OUT_A)); } //Wait(5000); }