dhgdh

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by joey shelton

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "rtos.h"
00003 #include "SDFileSystem.h"
00004 
00005 #define FILE_LOC "/sd/test.txt"
00006 
00007 Serial pc(USBTX, USBRX);
00008 Serial gps(p28, p27);
00009 Serial test(p9,p10);
00010 
00011 SDFileSystem sd(p11, p12, p13, p14, "sd");
00012 
00013 DigitalOut myled(LED1);
00014 DigitalOut sdled(LED2);
00015 
00016 void sd_thread(void const *argument) {
00017     while (true) {
00018         sdled = !sdled;
00019         FILE *fp = NULL;
00020         fp = fopen(FILE_LOC, "w");
00021         if( fp != NULL ) fclose(fp);
00022         Thread::wait(1000);
00023     }
00024 }
00025 
00026 int main() {
00027     Thread sdTask(sd_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE * 2.25);
00028     while (true) {
00029         myled = !myled;
00030         Thread::wait(1000);
00031     }
00032 }