Muhammad Fadhlika / Mbed OS WeatherStationRemote

Dependencies:   mbed-LoRa

Revision:
0:7b15c9c0a329
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jan 22 22:22:19 2018 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+#include "LoRa.h"
+
+Serial serial(PA_9, PA_10);
+
+int counter = 0;
+
+int main(void) {
+    serial.baud(115200);
+    if (!LoRa.begin(433E6)) {
+        serial.printf("Starting LoRa failed!\r\n");
+    } else {
+        serial.printf("Starting LoRa success!\r\n");
+    }
+    while (true){
+        serial.printf("Sending packet: %d\r\n", counter);
+
+        // send packet
+        LoRa.beginPacket();
+        LoRa.printf("hello %d", counter);
+        LoRa.endPacket();
+
+        counter++;
+
+        wait(5);
+    }
+}
\ No newline at end of file