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:
- bwang
- Date:
- 2017-02-28
- Revision:
- 2:11238235cb62
- Parent:
- 1:1b008c088fcc
File content as of revision 2:11238235cb62:
#include "mbed.h"
#include "stm32f4xx_flash.h"
#include "FlashWriter.h"
Serial pc(USBTX, USBRX);
int x;
int main() {
pc.baud(921600);
pc.printf("%s\n", "The program is running");
FlashWriter writer(4);
if (!writer.ready()) writer.open();
writer.write(0, (int) -38);
writer.write(1, (uint32_t) 1234);
writer.write(2, 4.14159f);
writer.close();
for(;;) {
pc.printf("%d %d %f\n", flashReadInt(4, 0), flashReadUint(4, 1), flashReadFloat(4, 2));
wait(1);
}
}