My Toy... |
Most of the items I bought are related to the RC Car idea I have had for my final year project. Read More
SimpleViewer requires JavaScript and Flash Player. Get Flash.
To view this album using my old gallery, please click here
View Gallery Alone
To view this album using my old gallery, please click here
Shopping List
Nearly everything was ordered from SparkFun. They are a fantastic bunch, it's only a shame they are in the US, not England!- Arduino Pro Mini
- 1mW XBee module
- 3-Axis Accelerometer
- Pitch and Roll Gyro
- Yaw Gyro
- Red/Green/Blue LED
- 4x White LEDs
- Light Sensor
- I2C I/O Expander
- 128kB of EEPROM (4x ICs)
- Voltage Regulator
- Protoboard!
- And of course a box!
- Other bits and bobs, like resistors, transistors, wire etc...
Analog I/O
All 3 axis of the gyros are connected directly to the Arduino analog pins 0, 1 and 2.The light sensor is connected to analog pin 4.
Digital I/O
The red, green and blue are controlled by 3 of the Arduino PWM outputs on the digital lines 9, 10 and 11.3 of the 4 white LEDs are controllable via the other PWM outputs of the Arduino 3, 5 and 6.
The fourth white LED is controlled by an XBee PWM output.
I2C
| @ 0x1D | - 3-axis accelerometer |
| @ 0x50 | - EEPROM 0 |
| @ 0x51 | - EEPROM 1 |
| @ 0x52 | - EEPROM 2 |
| @ 0x53 | - EEPROM 3 |
| @ 0x20 | - I/O Expander |
I/O Expander
As the IC can only really sink current, a LOW output turns the LEDs on.The outputs are in 3-state at power on, with a pull-up resistor taking the outputs high.
Outputs should be set to high before they are used as an input.
If a logic 1 is applied to an I/O pin that was written to low, a large current flows to GND.
Side 0 (first byte)
| @ 00 | - Edge LED (0 is on) |
| @ 01 | - LED (0 is on) |
| @ 02 | - LED (0 is on) |
| @ 03 | - LED (0 is on) |
| @ 04 | - LED (0 is on) |
| @ 05 | - LED (0 is on) |
| @ 06 | - LED (0 is on) |
| @ 07 | - LED (0 is on) |
Side 1 (second byte)
| @ 10 | - EEPROM 0 Write Protect (1 = protect) |
| @ 11 | - EEPROM 1 Write Protect (1 = protect) |
| @ 12 | - EEPROM 2 Write Protect (1 = protect) |
| @ 13 | - EEPROM 3 Write Protect (1 = protect) |
| @ 14 | - 3-axis Accelerometer INT1 (1 = interrupt) |
| @ 15 | - 3-axis Accelerometer INT2 (1 = interrupt) |
| @ 16 | - Pitch / Roll Gyro power down (1 = power down) |
| @ 17 | - Yaw Gyro power down (1 = power down) |
Results
So far I have had a little play with everything.Wireless programming (thanks ladyada) is now working!
I needed to set T3 to 1 on the XBee inside my toy in order to get this working - yay!
