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.
Dependencies: mbed
Revision 1:8ded5dafc62c, committed 2020-06-21
- Comitter:
- sasakisho
- Date:
- Sun Jun 21 01:37:56 2020 +0000
- Parent:
- 0:14e4f511a1bd
- Commit message:
- version1
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Jun 20 06:13:44 2020 +0000
+++ b/main.cpp Sun Jun 21 01:37:56 2020 +0000
@@ -10,7 +10,7 @@
// this function has 63 bytes write limit
-void writeEEPROM(char address, unsigned int eeaddress, char *data, int size)
+void EEPROM_write(char address, unsigned int eeaddress, char *data, int size)
{
char i2cBuffer[size + 2];
i2cBuffer[0] = (unsigned char)(eeaddress >> 8); // MSB
@@ -25,7 +25,7 @@
}
// this function has no read limit
-void readEEPROM(char address, unsigned int eeaddress, char *data, int size)
+void EEPROM_read(char address, unsigned int eeaddress, char *data, int size)
{
char i2cBuffer[2];
i2cBuffer[0] = (unsigned char)(eeaddress >> 8); // MSB
@@ -44,20 +44,20 @@
{
int i, length;
char data_read[1];
- readEEPROM(ADDR, pointerAdddress, data_read, 1);
+ EEPROM_read(ADDR, pointerAdddress, data_read, 1);
pc.printf("Previous data stored: %s\n", data_read);
while(1)
{
- i = 1
- s[0] = i;
+
+ s[0] = 'a';
// write tha data
- writeEEPROM(ADDR, pointerAdddress, s, 1);
+ EEPROM_write(ADDR, pointerAdddress, s, 1);
pc.printf("Data written: %s\n", s);
// read the data
- readEEPROM(ADDR, pointerAdddress, data_read, 1);
+ EEPROM_read(ADDR, pointerAdddress, data_read, 1);
pc.printf("Data read: %s\n", data_read);
wait(1);