/* Simple Ramp demo for showing variable speed with two modified servos or similar devices by Brian Patton 8/07/14 Feel free to do whatever you want with this code example */ #include <Servo.h> //The Servo Library // Create Variables to hold the Receiver signals // Create Servo Objects as defined in the Servo.h files Servo R_DCMotor; // Servo DC Motor Driver (Designed for RC cars) Servo L_DCMotor; // Servo DC Motor Driver (Designed for RC cars) void setup() { // Attach Speed controller that acts like a servo to the board R_DCMotor.attach(0); //Pin 1 L_DCMotor.attach(1); //Pin 0 Serial.begin(9600); } void loop() { for(int z=1200; z<1700; z++) { R_DCMotor.writeMicroseconds(z); //Set speed sort of slow L_DCMotor.writeMicroseconds(z); //Set Speed sort of slow for(int i=0; i < z/10-100; i++) { Serial.print(" "); } Serial.println(z); delay(25); } for(int swink = 1700; swink > 1200; swink--) { R_DCMotor.writeMicroseconds(swink); //Set speed sort of slow L_DCMotor.writeMicroseconds(swink); //Set Speed sort of slow for(int i=0; i < swink/10-100; i++) { Serial.print(" "); } Serial.println(swink); delay(25); } }