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.
main.cpp
- Committer:
- fadhlika
- Date:
- 2018-01-22
- Revision:
- 0:7b15c9c0a329
File content as of revision 0:7b15c9c0a329:
#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);
}
}