Board support library for C027

Dependents:   IoTWorkshopLCD IoTWorkshopBuzzer IoTWorkshopSensors C027_USSDTest ... more

Fork of C027 by u-blox

/media/uploads/ublox/c027_pinout_new.png

Revision:
11:722101675ce4
Parent:
10:bc9e2eb5daa8
Child:
12:31fb5ff9fef5
--- a/C027.cpp	Wed Nov 06 10:23:53 2013 +0000
+++ b/C027.cpp	Sun Nov 10 18:44:53 2013 +0000
@@ -8,14 +8,24 @@
 
 void mbed_die(void)
 {
+#ifdef C027_REVA
+    DigitalOut led(A0);
+#else
     DigitalOut led(LED);
-    for (;;)
+#endif
+    led = 0;
+    // Send SOS in Morse Code: // "... --- ...  "
+    const char sos[] = "=.=.=...===.===.===...=.=.=......"; 
+    const int  dot = 100; // length of the dot in milliseconds (typical: 50-100 ms)
+    // lengths of symbols: 
+    // di         =   dot 
+    // dah        = 3 dot 
+    // char space = 3 dot 
+    // word space = 6 dot 
+    for (int i = 0; /* nothing */; i = sos[i+1] ? i+1 : 0)
     {
-        // nothing to do here
-        led = 0;
-        wait_ms(200);
-        led = 1;
-        wait_ms(200);
+        led = (sos[i] == '=');
+        wait_ms(dot);
     }
 }