Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- 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