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: SDFileSystem max32630fthr USBDevice
Fork of FTHR_SD_Demo by
main.cpp
- Committer:
- switches
- Date:
- 2016-11-16
- Revision:
- 1:90313362ec11
- Parent:
- 0:60a522ae2e35
- Child:
- 3:247c750f9f3d
File content as of revision 1:90313362ec11:
#include "mbed.h"
#include "max32630fthr.h"
#include "SDFileSystem.h"
DigitalOut rLED(LED1);
DigitalOut gLED(LED2);
SDFileSystem sd(P0_5, P0_6, P0_4, P0_7, "sd"); // mosi, miso, sclk, cs
// main() runs in its own thread in the OS
// (note the calls to Thread::wait below for delays)
int main()
{
gLED = LED_OFF;
rLED = LED_ON;
max32630fthrInit();
vddioh(P0_4, TRUE);
vddioh(P0_5, TRUE);
vddioh(P0_6, TRUE);
vddioh(P0_7, TRUE);
gLED = LED_ON;
FILE *fp = fopen("/sd/myfile.txt", "w");
fprintf(fp, "Hello World!\n");
fclose(fp);
rLED = LED_OFF;
while (true) {
gLED = !gLED;
Thread::wait(500);
}
}
