This is a code for Game pad to control a Boat or a tank using MMA7361 accelerometer + serial XBee
## Game pad MMA7361 + serial XBee
This game pad is no button controller to drive a boat, a car, or a tank with simle inclination:
Valid values for x and y from -250 to +250:
-forward....100 to +250
-stop......-100 to +100
-backward..-250 to -100
-left......-250 to -100
-right......100 to +250
### How it works:
-switch controller on
-LED turns on for 1 sec
-LED turns off - indicate accelerometer started callibration
-LED turns on - accelerometer callibrated
-press the single button to send commands (safety switch)
-not pressed buttons => only stop command is sent
I made this for my son to not confuse him with buttons :-)
### Hardware
-Arduino (Uno, Nano)
-MMA7361 accelerometer
-XBee
-Wires
### Make this circuit Game pad
![enter link description here](http://www.robotplace.com/wp-content/uploads/2014/06/Game_pad_from_accelerometer3.png)
### XBee Configuration
Embed This Sketch
Use the following HTML code to embed the sketch code above in your blog or website.
<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:425306" frameborder="0"></iframe>
Embed The Serial Monitor
You can also embed the Serial Monitor section! Just use this HTML code.
<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>