Physical computing -> wireless two-way data -> physical control. This is a intuitive, durable, and fun way to control almost anything. Here I’ve built a transmitter which reads data from the Wii nunchuck and sends it over xbee. The rover receives the xbee broadcast, decodes it, maps it to drive the tank-like dual motor setup, and controls the motor driver IC. To achieve my goal of a small mint-tin fitted remote I used a lithium polymer (LiPo) battery, and to make them safer I included a voltage monitoring subroutine. The result is modular, easily incorporated into future projects, or disassembled for different use. Here are more details:
Arduino pro mini (3.3V version), xbee series 2.5, used wii nunchuck, lipo battery, old off-brand mint tin.
9V battery, Xbee, ATmega168, SN754410 H-Bridge motor IC, lego motors
| int ledPin = 13;
void setup(){
Serial.begin(115200);
nunchuck_init();
pinMode(ledPin, OUTPUT);
//print inital battery charge
Serial.print("b=");
Serial.print(update_batt_status());
Serial.println("%");
}
void loop() {
nunchuck_get_data();
if (((nunchuck_buf[5] >> 0) & 1) ? 0 : 1){
digitalWrite(ledPin, HIGH);
send_packet();
}
else digitalWrite(ledPin, LOW);
|
These are provided under the same licence as my photos: Creative Commons Attribution-Noncommercial-Share Alike 3.0. Click on either image to download the one of the sketches.