Having built the robot and installed the Arduino IDE, let's run some code to test stuff.
In what follows, I mention "Your Arduino directory/folder". On Windows this is in your Documents folder. On Linux it is ~/Arduino. Not sure where it is on the Mac. You can set it to be somewhere else, but those are the defaults.
Your Arduino directory should look like:
$ ls ~/Arduino libraries $ ls ~/Arduino/libraries Adafruit_NeoPixel Encoder_cga Keyboard notes.txt Encoder I2Cdev MPU6050 readme.txt
Your Arduino directory should now look like:
$ ls ~/Arduino libraries test2_MPU6050 test_button test_encoders2 test_servo test1_MPU6050 test3_MPU6050 test_encoders test_lights test_voltage
Each sketch (program) tests some aspect of the robot. These programs expect you to have a serial monitor running at 115200 baud, and the USB cord attached, as they print stuff out. CTRL-SHIFT-M is a shortcut to getting you a serial monitor window, which is also available from the "Tools" menu. The USB cord may be able to power the robot sufficiently to turn the wheels, depending on your computer's USB port. To get the motors to really move, turn your battery on (charge it fully (until the green light goes out) first).
To run a particular sketch, click on FILE, and then OPEN. You will see a menu of the sketches. Double click on test_button (a directory), and then on test_button.ino (a program, Arduino programs are xxx.ino). You will then see the text of test_button.ino. Click on right arrow to download and run it. Get a monitor window going by typing CTRL-SHIFT-M, and set the baud rate to 115200. Stuff might type out. Press the button on the motherboard. Stuff should type out, and the LED should change state (on to off, or vice versa).
It is useful to put the robot upside down on a desk so you can manipulate
it to get interesting readings from the IMU and encoders, and not have
problems when testing the motors.
To test the modifications made to the motherboard (the wires added on
the bottom) run the test_encoders program. Get a monitor window going.
When you turn each wheel, both numbers for that wheel (counts on the A
and B encoder lines) should change. Run test_encoders2. When you turn
a wheel the counts for that wheel should increment for a turn in one
direction, and decrement for a turn in the other direction. You should
be able to make the counts go negative. If not, something is wrong.
Here is a video of test_servo running.
The battery is turned on. Your results may be different, as I played
with the TARGET.
Ignore this error message:
If when you press the Verify (checkmark) button things compile with no
error messages, press the Download (right arrow) button.
If you get error messages other than the one above, try waiting 10 seconds
and pressing the Download (right arrow) button again.
Sometimes I have to do this several times. If it still doesn't download:
Sometimes the loading process fails, and the Download button stays yellow
for 30 seconds or more.
Press it again.
When you get this error message:
If you get a message saying "can't open device" that doesn't go away when
you press Download again:
-> USB cable to arduino not plugged in.
Don't pick up the robot by the translucent plastic stand. That comes off
if you are not careful.
I increment and print out a version number to make sure the download worked.
"tumbller version 31"
Some notes
avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description
avrdude: jtagmkII_getsync(): sign-on command: status -1
Push the download button again after a while