Tuesday, July 6, 2010

up and running

Today Geoff and Andy got the R running around the grounds. The "brains" were loaded into an arduino which was wired into the R's drive train. Sorry about the video being sideways. I don't have any video editing software just yet.

5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. #include Servo.h /* html doesn't seem to like carrots, less than, greater than, <>, but they ought to go around the library name.*/

    Servo frontServo;
    int motorPin = 11;
    int servoPin = 10;

    int stopSpeed = 127;
    int maxSpeed = 145;

    int turnTime = 2000;
    int straightTime = 300;

    int leftTurn = 75;
    int rightTurn = 135;
    int straight = 105;

    void setup()
    {
    frontServo.attach(servoPin);
    }

    void loop()
    {

    for(int thrustValue = stopSpeed ; thrustValue >= maxSpeed; thrustValue +=5)
    {
    analogWrite(motorPin, thrustValue);
    }

    frontServo.write(straight);
    delay(straightTime);
    frontServo.write(leftTurn);
    delay(turnTime);
    frontServo.write(straight);
    delay(straightTime);
    frontServo.write(rightTurn);
    delay(turnTime);

    for(int thrustValue = maxSpeed; thrustValue >= stopSpeed; thrustValue -=5)
    {
    analogWrite(motorPin, thrustValue);
    }


    }

    ReplyDelete
  4. Great work hacking up the code Geoff!

    ReplyDelete
  5. Congratulations on getting the MAX robot working with the arduino!

    ReplyDelete