Lora support for the STM B_L072Z_LRWAN1 board out of the box. Also supports HopeRF RFM95, Murata CMWX1ZZABZ and Semtech SX1276MB1MAS/SX1276MB1LAS modules.

Dependencies:   BufferedSerial SX1276GenericLib mbed USBDeviceHT

Committer:
Helmut64
Date:
Sun Jun 03 18:33:17 2018 +0000
Revision:
19:992eda680d91
Parent:
18:d5527ce82e6b
Child:
20:a1029437adca
Updated SX1276 lib to latest version.; Added LoRa radio initialisation to support HELTEC L4.;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Helmut64 0:c43b6919ae15 1 /*
Helmut64 17:98f2528e8399 2 * Copyright (c) 2018 HELIOS Software GmbH
Helmut64 0:c43b6919ae15 3 * 30826 Garbsen (Hannover) Germany
Helmut64 0:c43b6919ae15 4 * Licensed under the Apache License, Version 2.0);
Helmut64 0:c43b6919ae15 5 */
Helmut64 0:c43b6919ae15 6 #include "main.h"
Helmut64 0:c43b6919ae15 7
Helmut64 0:c43b6919ae15 8
Helmut64 19:992eda680d91 9 DigitalOut led(LED);
Helmut64 19:992eda680d91 10 DigitalOut led2(LED2);
Helmut64 0:c43b6919ae15 11
Helmut64 19:992eda680d91 12 Timeout tim;
Helmut64 19:992eda680d91 13 void ledBlink(void)
Helmut64 19:992eda680d91 14 {
Helmut64 19:992eda680d91 15 tim.attach(callback(&ledBlink), 0.200);
Helmut64 19:992eda680d91 16 led2 = !led2;
Helmut64 19:992eda680d91 17 }
Helmut64 19:992eda680d91 18
Helmut64 19:992eda680d91 19 int main() {
Helmut64 17:98f2528e8399 20 /*
Helmut64 17:98f2528e8399 21 * inits the Serial or USBSerial when available (230400 baud).
Helmut64 17:98f2528e8399 22 * If the serial uart is not is not connected it swiches to USB Serial
Helmut64 17:98f2528e8399 23 * blinking LED means USBSerial detected, waiting for a connect.
Helmut64 17:98f2528e8399 24 * It waits up to 30 seconds for a USB terminal connections
Helmut64 17:98f2528e8399 25 */
Helmut64 19:992eda680d91 26 InitSerial(30*1000, &led);
Helmut64 17:98f2528e8399 27 dprintf("Welcome to the SX1276GenericLib");
Helmut64 18:d5527ce82e6b 28
Helmut64 17:98f2528e8399 29 dprintf("Starting a simple LoRa PingPong");
Helmut64 19:992eda680d91 30 ledBlink();
Helmut64 19:992eda680d91 31
Helmut64 17:98f2528e8399 32 SX1276PingPong();
Helmut64 0:c43b6919ae15 33 }