Resources and samples for robotics summer camp
#Setup Instructions
##Arduino IDE
- Download the Arduino IDE for your platform from http://www.arduino.cc/en/Main/Software
- If you are using Windows, install the drivers for the Arduino Uno by following the instructions at http://www.arduino.cc/en/Guide/Windows#toc4
##Import Libraries
- Download MSMotorShield.zip and NewPing.zip and save them to any location on your computer
- Launch the Arduino IDE
- Open the Sketch menu -> Include Library -> Add .ZIP Library
- Browse to the MSMotorShield.zip file
Repeat #3-4 for NewPing.zip
##Deploying Code
- Download code samples Samples.zip and extract to any location on your computer. You can also copy/paste the samples using the links at the bottom of this page.
- Connect the Arduino to your computer via the USB Cable
- Launch the Arduino IDE
- Ensure that the "Arduino Uno" is selected under the Tools -> Board menu
- Ensure that the Arduino device is recognized and selected under the Tools -> Port menu
- Open a sample from the File -> Open menu or paste one into the Editor
- Click the Upload button in the upper left toolbar of the Arduino IDE to deploy
##Robot Schematic
![Image] (robot-schematic.png)
##Samples
###navigate.ino
This program is set up to continually drive forward until an obstacle is detected, and then turn. The goal is to navigate around a rectangular/square enclosure.
Change the line at the end of void loop()
to turnLeft()
if left turns are desired.
This program can be adapted to navigate around various obstacles by repeatedly chanining the while (dist > 15 or dist == 0)
loop and calls to turnRight()
or turnLeft()
This program simply drives forward until an obstacle is detected, and then stops.
###turntest.ino
This program simply executes one call to turnRight()
and then stops. Useful for tuning the delay
in milliseconds that is used during the turns