Or...
... if you want to make a robot craft that isn't really hard...?
After attending the L.A. Robotics Club Ardbot build on Easter Saturday, expertly led by Michael Belanger (whose schematics and code are all generously available here) and then replicating the workshop at both Washington Preparatory High School and Venice High School later in the week, we determined that, young or old, brave or bold, the Ardbot provides the best platform for rapidly engaging students, teachers, parents and community members in Arduino based robotics and for developing and testing the code and behaviors we want our Sea Perch/Sea Hawk to do.
With this in mind, then, we now formally recommend the Ardbot build as an essential piece of our curriculum and 12 step plan for aquatic robotics, coming right after the Sea Perch build and working concurrently with the wiring of a Sea Perch junction box to be used with the Arduino. In this plan students test out code on the Ardbot, and after achieving functionality on this rolling classroom platform, learn to modify that code for the relevant robosub or roboboat motor shield (whether used with Sea Perch or Sea Hawk).
Both Washington Prep High School students and Venice High students completed the basic Ardbot build and testing in under 2 hours. In the third hour they were able to control the Ardbot from the keyboards of their computers using an Xbee wireless shield. As Ian, one of the students from Venice High Robotics Club who hung out working after school until the end declared "I am so glad I stayed until we got to the really cool part!!".
Here is Michael Belanger's schematic for wiring the
In the video below, Carlos and Ian run the Ardbot wirelessly with the same code we will be using to steer the Sea Hawk:
The code Google volunteer Joe Davorin helped us mod from Andy Harris' Boatduinode so we could run the Ardbot from the Arduino IDE serial monitor is as follows:
//this is the same Andy Tuna Harris Boatduinode code we use for
//Sea Hawk now ported
// to the Ardbot H-bridge via Arduino so
//that the students can test out their Sea Hawks in the classroom //before testing them in the water!
const int motorAPWM = 3;
const int motorAL1 = 2;
const int motorAL2 = 4;
const int motorBPWM = 10;
const int motorBL1 = 9;
const int motorBL2 = 11;
void setup()
{
Serial.begin(9600);
pinMode(motorAPWM, OUTPUT);
pinMode(motorAL1, OUTPUT);
pinMode(motorAL2, OUTPUT);
pinMode(motorBPWM, OUTPUT);
pinMode(motorBL1, OUTPUT);
pinMode(motorBL2, OUTPUT);
// stop the motors
analogWrite(motorAPWM, 0);
analogWrite(motorBPWM, 0);
}
void loop()
{
if (Serial.available() > 0) {
switch(Serial.read()) {
case 'w':
digitalWrite(motorAL1, HIGH);
digitalWrite(motorAL2, LOW);
analogWrite (motorAPWM, 255);
digitalWrite(motorBL1, HIGH);
digitalWrite(motorBL2, LOW);
analogWrite (motorBPWM, 255);
Serial.println("Both motors activated, moving forward");
break;
case 's':
digitalWrite(motorAL1, LOW);
digitalWrite(motorAL2, HIGH);
analogWrite (motorAPWM, 255);
digitalWrite(motorBL1, LOW);
digitalWrite(motorBL2, HIGH);
analogWrite (motorBPWM, 255);
Serial.println("Both motors activated, moving backward");
break;
case 'a':
digitalWrite(motorAL1, HIGH);
digitalWrite(motorAL2, LOW);
analogWrite (motorAPWM, 255);
digitalWrite(motorBL1, LOW);
digitalWrite(motorBL2, HIGH);
analogWrite (motorBPWM, 255);
Serial.println("Both motors activated, turning left");
break;
case 'd':
digitalWrite(motorAL1, LOW);
digitalWrite(motorAL2, HIGH);
analogWrite (motorAPWM, 255);
digitalWrite(motorBL1, HIGH);
digitalWrite(motorBL2, LOW);
analogWrite (motorBPWM, 255);
Serial.println("Both motors activated, turning right");
break;
case 'e':
digitalWrite(motorAL1, HIGH);
digitalWrite(motorAL2, LOW);
analogWrite (motorAPWM, 255);
analogWrite (motorBPWM, 0);
Serial.println("Left motor activated, moving forward");
break;
case 'q':
digitalWrite(motorBL1, HIGH);
digitalWrite(motorBL2, LOW);
analogWrite (motorBPWM, 255);
analogWrite (motorAPWM, 0);
Serial.println("Right motor activated, moving forward");
break;
case 'c':
digitalWrite(motorAL1, LOW);
digitalWrite(motorAL2, HIGH);
analogWrite (motorAPWM, 255);
analogWrite (motorBPWM, 0);
Serial.println("Left motor activated, moving in reverse");
break;
case 'z':
digitalWrite(motorBL1, LOW);
digitalWrite(motorBL2, HIGH);
analogWrite (motorBPWM, 255);
analogWrite (motorAPWM, 0);
Serial.println("Right motor activated, moving in reverse");
break;
case ' ':
analogWrite (motorBPWM, 0);
analogWrite (motorAPWM, 0);
Serial.println("Both motors stopped");
break;
}
}
}
Below are some random pictures from our Ardbot builds at the LA Robotics Club, Washington Prep High and Venice High:
No comments:
Post a Comment