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 SDFileSystem
main.cpp
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2019 ARM Limited 00003 * SPDX-License-Identifier: Apache-2.0 00004 */ 00005 00006 #include "mbed.h" 00007 #include "SDFileSystem.h" 00008 //#include "platform/mbed_thread.h" 00009 00010 Serial jy901(D1,D0); 00011 Serial pc(USBTX,USBRX); 00012 SDFileSystem sd(PA_7, PA_6, PA_5, PA_4, "sd"); // the pinout on the mbed Cool Components workshop board 00013 00014 // Blinking rate in milliseconds 00015 int main() 00016 { 00017 jy901.baud(9600); 00018 printf("Hello World!\n"); 00019 00020 mkdir("/sd/mydir2", 0777); 00021 FILE *fp = fopen("/sd/mydir2/sdtest.bin", "w"); 00022 00023 if(fp == NULL) { 00024 error("Could not open file for write\n"); 00025 } 00026 00027 while(1){ 00028 fputc(jy901.getc(),fp); 00029 } 00030 fclose(fp); 00031 }
Generated on Fri Sep 2 2022 16:48:20 by
1.7.2