Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- soulx
- Date:
- 2015-10-26
- Revision:
- 3:8d9d440c1a2c
- Parent:
- 2:27acee628363
- Child:
- 4:3a9d307d26e2
File content as of revision 3:8d9d440c1a2c:
#include "mbed.h"
#include "eeprom.h"
EEPROM memory(I2C_SDA,I2C_SCL,0);
int main()
{
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);
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]);
printf("float = %f\n",x);
printf("int16 =%d\n",z);
}