Step-by step introduction to I2C EEPROM
Dependencies: mbed
Diff: main.cpp
- Revision:
- 3:58bd0878bb0f
- Parent:
- 2:41fccbb2e863
--- a/main.cpp Tue Jan 12 22:18:21 2016 +0000 +++ b/main.cpp Wed Jan 13 09:29:03 2016 +0000 @@ -22,8 +22,13 @@ data_write[1] = 0; // Type data data_write[2] = 1; - i2c.write(EEPROM_ADDR, data_write, 3); - wait_ms(6); // Wait eeprom internal write cycle (5ms) + 1ms + uint8_t i; + for( i=0; i < 255; i++ ) { + data_write[1] = i; + data_write[2] = i; + i2c.write(EEPROM_ADDR, data_write, 3); + wait_ms(6); // Wait eeprom internal write cycle (5ms) + 1ms + } // Reset eeprom pointer address char eeprom_address[2] = {0, 0}; i2c.write(EEPROM_ADDR, eeprom_address, 2, true);