Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Started a project months ago with plans to save settings to an eeprom. I wrote some test code at the time to make sure i2c wouldn't be a hurdle. Here's what I've got:
#include "mbed.h" I2C i2c(I2C_SDA, I2C_SCL ); int readVariable; int address = 0xa1; char array[1] ; char arrayRead[1]; int main() { while (1) { array[1] = 0x07; // just a random number i2c.start(); i2c.write(address,array,1); //write to address i2c.read(address,arrayRead,1); //read from address i2c.stop(); wait(.01); readVariable = arrayRead[0]; printf("variable = %i\r\n", readVariable); wait(1); } }It simply writes a single number to an address. It works, but I'm not sure how to proceed.
I need to save a list of 18 8 bit variables at a time to 8 "banks"
I think I need to offset my addresses, but I haven't seen (or understood) the examples I've seen. Can anyone point me in the right direction? I'm using a nucleo 32f303k8 and 24aa64f eeprom if that makes any difference.
Thanks