Firmware for the mbed in the BlueSync Sensor platform. Intended to communicate with a BlueGiga BLE112 Bluetooth LE module over UART.

Dependencies:   TimerCapture mbed

Revision:
1:cb941edd7bce
Parent:
0:2bc22bc992ac
Child:
2:ac474fccf29b
--- a/main.cpp	Sat May 23 22:02:10 2015 +0000
+++ b/main.cpp	Sun May 24 06:28:41 2015 +0000
@@ -1,9 +1,13 @@
 #include "mbed.h"
 #include "TimerCapture.h"
+#include "bluesync_types.h"
 
-Serial ble112(p9, p10);
-TimerCapture * capPin;
-DigitalOut myled(LED1);
+/** @file main.cpp
+@brief Main for the BlueSync mbed application. */
+
+Serial ble112(p9, p10); ///< Serial connection for communicating with the BLE112.
+TimerCapture * capPin; ///< Capture pin, wired to GPIO pin on BLE112.
+DigitalOut bleScanningLed(LED1);
 
 void on_serial_rcv() {
     ble112.getc();
@@ -21,6 +25,13 @@
         hw_addr[4], 
         hw_addr[5]);
     printf("Obs At: %d\r\n", capPin->getTime());
+    
+    intByteArray bitArray;
+    bitArray.integer = capPin->getTime();
+    
+    for (int i = 3; i >= 0; i--) {
+        ble112.putc(bitArray.byte[i]);
+    }
 }
 
 int main() {