My first arduino rover

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.

Navigate around via ping))) ultrasound detector.

  • Actuators / output devices: 2 solarbotics GM9 gearmotors (143:1), 1 standard servo
  • CPU: Arduino Duemilanove (328)
  • Power source: 1 9v & 4AA's
  • Programming language: C
  • Sensors / input devices: Ping))) Ultra Sound
  • Target environment: Indoors - Carpet

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/my-first-arduino-rover

Hi.

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

hi there i to am building
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

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();
}
}
}

hey there.
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