Embedded systems project
Dependencies: mbed C12832 SDFileSystemwithdisplay
main.cpp
- Committer:
- lpeltoni
- Date:
- 2019-10-13
- Revision:
- 2:4f9836ac8d6b
- Parent:
- 0:bdbd3d6fc5d5
File content as of revision 2:4f9836ac8d6b:
#include "mbed.h" #include "SDFileSystem.h" #include "C12832.h" SDFileSystem sd(PA_7, PA_6, PA_5, PA_2, "sd"); // the pinout on the mbed Cool Components workshop board C12832 lcd(PA_7, PA_5, PA_9, PA_1, PA_0); int main() { lcd.cls(); lcd.locate(0,3); lcd.printf("Hello World!\n"); mkdir("/sd/mydir", 0777); FILE *fp = fopen("/sd/mydir/sdtest.txt", "w"); if(fp == NULL) { error("Could not open file for write\n"); } fprintf(fp, "Hello fun SD Card World!"); fclose(fp); wait(1.0); lcd.cls(); lcd.locate(0,15); lcd.printf("Goodbye World!\n"); }