Muhammad Fadhlika / Mbed OS WeatherStationRemote

Dependencies:   mbed-LoRa

Files at this revision

API Documentation at this revision

Comitter:
fadhlika
Date:
Mon Jan 22 22:22:19 2018 +0000
Commit message:
sending test;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-LoRa.lib Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib 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	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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-LoRa.lib	Mon Jan 22 22:22:19 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/fadhlika/code/mbed-LoRa/#c28964675044
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Mon Jan 22 22:22:19 2018 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#96d9a00d0a1d25095b330095fa81c40f7741777c