Arduino Servo Shield Sequencer with 256K External EEPROM
by Adriaan | October 18, 2009|
The Servo Shield Sequencer works great for short sequences, up to 255 steps, but what if you need more than 255 steps? Change all bytes in the protocol to int and add more memory... Adding extra EEPRom to the Arduino is extremly easy Ghetto Hax has a very good tutorial showing how to add external I2C EEPRom to the Arduino. Within 10 minutes you can go from having only 1Kbyte of EEPRom on the Duemilanove to having 32Kbytes. The sequencer's memory management has two main changes, one to allow easily switching between the external and internal EEProm and the other to simplify tracking the current read/write address pointer. |
![]() |
The first was easily achieved bycreating new read and write functions that uses a compiler define to decide whether to use the external or internal EEProm, and the second was done by adding a reference parameter to the read and write functions to update the address pointer as the data is read/written.
e.g
To use the new sequencer simply use the prototyping area on the Servo Shield to wireup the external EEProm, e.g. 24LC256, see schematic below (Using a mini breadboard makes short term prototyping easier). As before import the EEPROM and Servo Shield libraries and add EEPROM.pde and Sequencer.pde to your sketch. In your sketch's setup method initialize the sequencer first and in your loop method simply poll the serial comms and the sequencer.
e.g.

Full code is available with the Renbotics Servo Shield library: servoshield.zip
Requirements:
- 1 x Arduino Duemilanove or Seeeduino
- 1 x Renbotics Servo Shield
- 1 x 256kbit I2C EEPROM (24LC256)
- 2 x 4.7K resitors
- Min 1 x Servo
- Breadboard jumper wires
- Mini breadboard recommended


FEED