This program is guided to help establish a connection between two RFM95 900MHz LoRa radio modules using Maxim Integrated's Feather MCUs (MAX32630FTHR Mbed and the MAX32620FTHR Mbed). Once the radios are configured after powering on and if the radios are wired correctly, the two radios will self identify as either a master or a slave, and will then proceed to PING and PONG back and forth. Information about what is happening between the radios can be seen if the two boards are hooked up to a USB COM port through the included DAPLINK/MAX32625PICO modules.

Dependencies:   BufferedSerial SX1276GenericLib USBDeviceHT max32630fthr

Fork of MAX326xxFTHR_LoRa_PingPong by Devin Alexander

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002  * Copyright (c) 2018 HELIOS Software GmbH
00003  * 30826 Garbsen (Hannover) Germany
00004  * Licensed under the Apache License, Version 2.0);
00005  */ 
00006  #include "main.h"
00007 
00008  #if defined(TARGET_MAX32630FTHR) // using the RFM95 board
00009    #include "max32630fthr.h"
00010     MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
00011  #endif
00012 
00013 DigitalOut myled(LED);
00014 
00015 
00016 int main() {
00017 #ifdef HELTEC_STM32L4
00018     DigitalOut vext(POWER_VEXT);
00019     vext = POWER_VEXT_ON;
00020 #endif    
00021 
00022 
00023     /*
00024      * inits the Serial or USBSerial when available (230400 baud).
00025      * If the serial uart is not is not connected it swiches to USB Serial
00026      * blinking LED means USBSerial detected, waiting for a connect.
00027      * It waits up to 30 seconds for a USB terminal connections 
00028      */
00029     InitSerial(30*1000, &myled);
00030     dprintf("Welcome to the SX1276GenericLib");
00031   
00032     dprintf("Starting a simple LoRa PingPong");
00033     SX1276PingPong();
00034 }