Smartage application
Dependencies: BufferedSerial SX1276GenericLib USBDeviceHT mbed Crypto X_NUCLEO_IKS01A2
Fork of STM32L0_LoRa by
main.cpp
- Committer:
- marcozecchini
- Date:
- 2018-05-17
- Revision:
- 19:7763501775e5
- Parent:
- 18:d5527ce82e6b
- Child:
- 20:1557c9d9c183
File content as of revision 19:7763501775e5:
/* * Copyright (c) 2018 HELIOS Software GmbH * 30826 Garbsen (Hannover) Germany * Licensed under the Apache License, Version 2.0); */ #include "main.h" DigitalOut myled(LED); //D12 TRIGGER D11 ECHO HCSR04 sensor(D12, D11); int main() { #ifdef HELTEC_STM32L4 DigitalOut vext(POWER_VEXT); vext = POWER_VEXT_ON; #endif /* * 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); dprintf("SMARTAGE"); while(1){ //Ultrasonic measurement long distance = sensor.distance(); dprintf("distance %d \n",distance); char message[8];//Message to be sent sprintf(message, "%d", distance); dump("Check: ", (uint8_t*)message, 8); SendAndBack((uint8_t*)message); } }