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: EthernetInterface SDFileSystem mbed-rtos mbed
Diff: main.cpp
- Revision:
- 3:998f7fb862af
- Parent:
- 2:e699312248f3
--- a/main.cpp Mon Dec 05 22:46:14 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -#include "mbed.h" -#include "SDFileSystem.h" -#include "cli.hpp" -#include "file_manager.hpp" - -SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd"); // MOSI, MISO, SCK, CS -Serial pc(USBTX, USBRX); -// DigitalIn enable(SW2); -DigitalOut led(LED1); - -int main() -{ - cli_sd cli; - file_manager fm; - char cmd; - - cli.welcome(); - cli.print_help(); - - while(1) - { - cmd = cli.get_cmd(); - - switch(cmd) - { - case 'm': - break; - case 'p': - fm.set_path(); - break; - case 'w': - fm.write_to_file(); - break; - case 'a': - fm.append_to_file(); - break; - case 'r': - fm.read_file(); - break; - default: - pc.printf("Error.\n"); // should never enter this - break; - } - } - - while(1) { - if(!true) { - //pc.printf("\r\nThis is: %c", cmd); - //pc.scanf(cmd); - if (pc.writeable()) - { - led = !led; - } - } - wait(0.25); - } - - while(1) { - FILE *fp = fopen("/sd/testfile.txt", "a"); - fprintf(fp, "hello world!\r\n"); - fclose(fp); - wait(1); - } -} \ No newline at end of file