Fork for LoDev S76S
Dependencies: mbed BufferedSerial SX1276GenericLib USBDeviceHT
Diff: main.cpp
- Revision:
- 19:992eda680d91
- Parent:
- 18:d5527ce82e6b
- Child:
- 20:a1029437adca
--- a/main.cpp Mon Mar 12 15:00:02 2018 +0000 +++ b/main.cpp Sun Jun 03 18:33:17 2018 +0000 @@ -6,23 +6,28 @@ #include "main.h" -DigitalOut myled(LED); - +DigitalOut led(LED); +DigitalOut led2(LED2); -int main() { -#ifdef HELTEC_STM32L4 - DigitalOut vext(POWER_VEXT); - vext = POWER_VEXT_ON; -#endif +Timeout tim; +void ledBlink(void) +{ + tim.attach(callback(&ledBlink), 0.200); + led2 = !led2; +} + +int main() { /* * inits the Serial or USBSerial when available (230400 baud). * If the serial uart is not is not connected it swiches to USB Serial * blinking LED means USBSerial detected, waiting for a connect. * It waits up to 30 seconds for a USB terminal connections */ - InitSerial(30*1000, &myled); + InitSerial(30*1000, &led); dprintf("Welcome to the SX1276GenericLib"); dprintf("Starting a simple LoRa PingPong"); + ledBlink(); + SX1276PingPong(); }