//The Drive void Tank(int y1, int y2) { int powLeft = scaleJoystick(y1)/slowMode(joy1Btn(joySlow),joy1Btn(joySuperSlow))*1.0; // Left hand joystick, y value. int powRight = scaleJoystick(y2)/slowMode(joy1Btn(joySlow),joy1Btn(joySuperSlow))*1.0; // Right hand joystick, y value. if (!tankSpeed){ // This defines our speed. powLeft = powLeft/6; powRight = powRight/6; } SetMotors(powLeft, powRight); // writeDebugStreamLine("scaleJoystick %d %d", y1, y2); }
void loop() { i++; switch(i) { case 10: slowMode(); break; case 15: defaultMode(); break; case 25: fastMode(); break; case 40: i=0; break; } GPIO_ToggleBits(GPIOD, LEDS); delay(300); }