#include "svt.h" void Start() { // Take control of the motors: OpenMotors(); } bool Run() { //Check if it's time to quit if (GetRemoteKeys() & KEY_HOME) return false; // create and integer variable called "i" int i; // put a count from 0 to 10000 in "i" for (i=0; i<=10000; i++) { // Pause 1 millisecond Sleep(1); // Set the Right motor speed to the current count SetRightMotor(i); // Set Left motor to the negative of the current count SetLeftMotor(-i); } // count from 0 to 10000 for (i=10000; i>=0; i--) { // Pause 1 millisecond Sleep(1); // Set the Right motor speed to the current count SetRightMotor(i); // Set Left motor to the negative of the current count SetLeftMotor(-i); } // Release the motors so the remote can regain control CloseMotors(); // Do nothing for 5 seconds: Sleep(5000); // Take back control of the motors: OpenMotors(); return true; } void End() { // remember to let go when you finish... CloseMotors(); }