From 8ffaccbd5fdc0b2bb4a06b334f99e6f50e6e6bbb Mon Sep 17 00:00:00 2001 From: Pawel Spychalski Date: Thu, 23 Nov 2017 14:41:11 +0100 Subject: [PATCH] TX power moved to configuration --- .vscode/tags | 6 ++++++ crossbow.ino | 4 ++++ variables.h | 1 + 3 files changed, 11 insertions(+) create mode 100644 .vscode/tags diff --git a/.vscode/tags b/.vscode/tags new file mode 100644 index 0000000..d01d39b --- /dev/null +++ b/.vscode/tags @@ -0,0 +1,6 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.8 // diff --git a/crossbow.ino b/crossbow.ino index ce06101..8bb0e80 100644 --- a/crossbow.ino +++ b/crossbow.ino @@ -156,10 +156,14 @@ void setup(void) while (true); } + //Configure LoRa module LoRa.setSignalBandwidth(radioState.loraBandwidth); LoRa.setSpreadingFactor(radioState.loraSpreadingFactor); LoRa.setCodingRate4(radioState.loraCodingRate); + LoRa.setTxPower(radioState.loraTxPower); LoRa.enableCrc(); + + //Setup ISR callback and start receiving LoRa.onReceive(onReceive); LoRa.receive(); diff --git a/variables.h b/variables.h index 7ed84c1..397edcb 100644 --- a/variables.h +++ b/variables.h @@ -79,6 +79,7 @@ struct RadioState_t { uint32_t loraBandwidth = 250000; uint8_t loraSpreadingFactor = 7; uint8_t loraCodingRate = 6; + uint8_t loraTxPower = 17; // Defines output power of TX, defined in dBm range from 2-17 int8_t bytesToRead = -1; uint8_t rssi = 0; uint8_t snr = 0;