MAX326xxFTHR LoRa Example

Dependencies:   BufferedSerial SX1276GenericLib max32630fthr USBDeviceHT

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   
00007  /*
00008  * For Wiring Instructions, please visit the link below:
00009  * https://www.hackster.io/DevinAlex64/getting-started-with-the-max32620fthr-and-lora-f9d8dd\
00010  */
00011  
00012  #include "main.h"
00013 
00014  #if defined(TARGET_MAX32630FTHR) // using the RFM95 board
00015    #include "max32630fthr.h"
00016     MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
00017  #endif
00018 
00019 DigitalOut myled(LED);
00020 
00021 
00022 int main() {
00023 #ifdef HELTEC_STM32L4
00024     DigitalOut vext(POWER_VEXT);
00025     vext = POWER_VEXT_ON;
00026 #endif    
00027 
00028 
00029     /*
00030      * inits the Serial or USBSerial when available (230400 baud).
00031      * If the serial uart is not is not connected it swiches to USB Serial
00032      * blinking LED means USBSerial detected, waiting for a connect.
00033      * It waits up to 30 seconds for a USB terminal connections 
00034      */
00035     InitSerial(30*1000, &myled);
00036     dprintf("Welcome to the SX1276GenericLib");
00037   
00038     dprintf("Starting a simple LoRa PingPong");
00039     SX1276PingPong();
00040 }