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:
- rary
- Date:
- 2020-07-09
- Revision:
- 1:e5497e7c8c79
- Parent:
- 0:f6e222782355
- Child:
- 2:292423de1497
File content as of revision 1:e5497e7c8c79:
#include "mbed.h"
#include "EEPROM.h"
EEPROM rom(p9, p10);
Serial pc(USBTX, USBRX);
#define ADDR 0xA0 //EEPROMコントロールアドレス
int pointerAddress = 0; //EEPROM保存アドレス
int main()
{
char data_read[128];
pc.baud(460800); //ボーレート変更
pc.printf("Start!");
for(int i = 0;i < 500; i++)
{
rom.write(ADDR, pointerAddress, '\0', 128); // write tha data
pointerAddress = pointerAddress + 128; //アドレスずらし
}
pointerAddress = 0;
pc.printf("Data read\r\n");
for(int n = 0; n < 500; n++)
{
rom.read(ADDR, pointerAddress, data_read, 128);
wait_ms(5);
pc.printf("%s\r\n", data_read);
pointerAddress = pointerAddress + 128; //アドレスずらし
memset(data_read, '\0', 128 ); //初期化
}
pc.printf("Finish!\r\n");
}