SmartPlant Hydrophonic Plant System

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Arkadi
Date:
Thu Apr 26 11:24:21 2018 +0000
Child:
1:62bcb62b37cc
Commit message:
STM32 Communication BLE + PC

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 26 11:24:21 2018 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+
+//------------------------------------
+// Hyperterminal configuration
+// 57600 bauds, 8-bit data, no parity
+//------------------------------------
+
+Serial pc(SERIAL_TX, SERIAL_RX);
+Serial BLE(D1, D0);
+DigitalOut myled(LED1);
+
+int main()
+{
+    pc.baud(57600);
+    BLE.baud(57600);
+    pc.printf("Hello Plant!\r\n");
+    BLE.printf("Hello Plant !\r\n");
+    while(1) {
+        //wait(1);
+        //pc.printf("This program runs since %d seconds.\r\n", i++);
+        //BLE.printf("This program runs since %d seconds.\r\n", i++);
+        while(BLE.readable()) {
+            uint8_t in_byte = BLE.getc();
+            pc.putc(in_byte);
+        }
+        while(pc.readable()) {
+            uint8_t in_byte = pc.getc();
+            BLE.putc(in_byte);
+        }
+        myled = !myled;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 26 11:24:21 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/994bdf8177cb
\ No newline at end of file