Let's Make Robots!

My first arduino rover.

Navigate around via ping))) ultrasound detector.

This is my first robot rover I built with an arduino duemilanove and an Adafruit motorshield. It is not my first attempt however. The motors, tracks and metal frame were bought as a kit. The rover uses a Parallax Ping))) sensor to detect objects.

I plan to add infrared refectors and bumper switches in the future to make sure it does not drive of the table.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
i was wondering if you could share your full code. im still working on mine id like to see how you did yours if possible. thanks
hi there i to am building the same exact rover. but i have bitten off more than i chew im not a great coder. i was wondering if you could let me see your code for the sensor loop. i know how to read the sensor and make the vehicle move i use the adafruit motor/sensor shield. do you use an "if" statement to in affect force the rover to drive backwards when it reaches a object. if you dont want to show me your code thats fine but i would appreciate your help.

This is the main loop of my rover code:

void loop() {
  lookForward(); // position robot head so it looks forward

  while(distanceInCentimeters() > FORWARD_TRESHOLD) {
    moveForward();
    delay(500);
  }

  stopMotors();
  scanAround();  // find an exit

  if(leftScan > LEFT_TRESHOLD) {
    if( leftScan >= rightScan) {
      turnLeft();
    } else {
      turnRight();
    }
  } else if(rightScan > RIGHT_TRESHOLD) {
    if(rightScan > leftScan ) {
      turnRight();
    } else {
      turnLeft();
    }
  } else {
    // move backwards until the robot can make a turn
    do {
      moveBackward();
      scanAround();
    }
    while(leftScan <= LEFT_TRESHOLD && rightScan <= RIGHT_TRESHOLD);

    if(leftScan > LEFT_TRESHOLD) {
      turnLeft();
    } else {
      turnRight();
    }
  }
}

nice bot. video would be great. it looks nearly like my bot. i look for a task .. cause only drive around is lame

greez from germany