A7
/
Nucleo_eeprom
EEPROM
Fork of Nucleo_eeprom by
Diff: main.cpp
- Revision:
- 3:8d9d440c1a2c
- Parent:
- 2:27acee628363
- Child:
- 4:3a9d307d26e2
--- a/main.cpp Tue Aug 25 12:06:56 2015 +0000 +++ b/main.cpp Mon Oct 26 16:44:20 2015 +0000 @@ -2,26 +2,45 @@ #include "eeprom.h" -EEPROM memory(I2C_SDA,I2C_SCL,EEPROM_Address); + EEPROM memory(I2C_SDA,I2C_SCL,0); int main() { - char value='A'; - char data[2]; - memory.write(1,value); - memory.write(2,'a'); + + + int8_t data_dummy='r'; + int8_t data[4]; + float x=0.0f,j=9785.26844; + int16_t y=0x3321,z; + + + memory.write(1,(int8_t)data_dummy); + wait_ms(1); + + memory.write(2,(int8_t)'c'); + wait_ms(1); memory.read(1,data,2); - printf("read[1] = %c\n",data[0]); + wait_ms(1); + + + memory.write(10,j); + wait_ms(1); + + memory.read(10,x); + wait_ms(1); + + + memory.write(1,(int16_t)y); + wait_ms(1); + memory.read(1,z); + wait_ms(1); + + printf("read[1] = %c\n",data[0]); printf("read[2] = %c\n",data[1]); - float x=0.0f; - memory.write(10,1.23f); - memory.read(10,x); - printf("float = %f\n",x); - - int16_t y=16200,z; - memory.write(1,y); - memory.read(1,z); + printf("float = %f\n",x); + printf("int16 =%d\n",z); + } \ No newline at end of file