Not sure where to put them, also dont know which pin indicates the presence of the SD card, Let me know if it doesn't work ill get back to it

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
bMcDonnell
Date:
Mon Jan 01 14:20:42 2018 +0000
Commit message:
Functions for the SD checker, Not sure where to put them in the grand scheme of things

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 8c3ab5ab0366 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jan 01 14:20:42 2018 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+
+Ticker SD_tick;
+DigitalIn SD_Present (pin number escapes me);
+//checks if pin has gone High
+void Check_SD_Present() {
+    if (SD_Present == 0) 
+        {   
+            //toggles the Yellow LED if no SD
+            yellowLED = !yellowLED;
+        }
+    else 
+        {   //If Pin goes high, flashes YellowLED 3x
+            for (int a = 1; a < 7; a++) {
+                yellowLED = !yellowLED;
+                wait(0.15);
+                }
+                //makes sure Yellow LED doesnt end up constantly on then
+                //turns on green LED to indicate SD present
+                yellowLED = 0;
+                greenLED = 1;
+        }
+        }
+        
+void Start_SD_Check() {
+        SD_tick.attach(this, &Check_SD_Present, 0.5)
+        }
+        
+        
+            
\ No newline at end of file
diff -r 000000000000 -r 8c3ab5ab0366 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jan 01 14:20:42 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e
\ No newline at end of file