For this version of the snake, various character inputs (numbers 1-6) affect the wave behavior.
OPTION 1: xbee+computer (see this instructable
for more info)
-Plug in xbee to the xbee explorer.
-Plug xbee explorer into your computer via the USB cable.
-Download and open CoolTerm
-Make sure the BAUD RATE is set to 57600.
-Make sure that after "PORT:" it says something like "usbserial-A700xxx". If not, select "RESCAN SERIAL PORTS".
-Make sure your xbee is set to 57600 baud rate:
Type "+++" (you might not see anything written in the serial port unless you have checked "LOCAL ECHO" in the TERMINAL tab of the OPTIONS.)
You should get "OK" returned in the serial monitor of CoolTerm. If you are not, perhaps xbee is not set to that baud rate. to debug, go back to OPTIONS and select "baud rate 9600" and try again.
Now you have entered xbee's "command mode".
Type "ATBD" then ENTER.(and don't wait too long or you will exit command mode).
You should get an integer returned, corresponding to the baud rate xbee is set at. To make sure it is set to 57600, type "ATBD 6" then ENTER.
You should get "OK" returned.
Now type "ATWR".
Now, when you type the characters 1-6 in the serial monitor, when the snake is turned on, the characters should affect the motion.
5&6: affect the speed of the rotation of the servos.
3&4: affect the period of the wave (speed of propagation down the line of servos).
1&2: affect the amplitude of the wave.
Visualize in software how the wave behavior is affected by the various parameters, or typing in integers 1-6..The attached graphs show the output angle values of each servo mapped over time, slightly out of phase from each other. The difference is when there is a different offset (delay in the time it takes one servo to get to the angle of the previous one in the line of waves).
If you don't want to use your computer, and want to have a free standing remote control, feel free to make an arduino based r/c. To do this, plug in the xbee to an xbee shield mounted on Arduino (see image). Make a 6 button inputs
. I hacked into a joystick that had 2 extra buttons. Connect the 6 buttons to Arduino digital pins 2-7.
Upload the following code to arduino.
And now affect the snake behavior the same way as through coolTerm.