Skip to content

Commit

Permalink
Fix transmit powers
Browse files Browse the repository at this point in the history
  • Loading branch information
aattww committed Jun 7, 2020
1 parent a30cc80 commit 8dcdf91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions SensorsBattery/SensorsBattery.ino
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
*/


#define VERSION 2
#define VERSION 3

#include <RH_RF95.h>
#include <RHReliableDatagram.h>
Expand Down Expand Up @@ -123,8 +123,8 @@

#define PAYLOAD_LEN 11
#define GATEWAYID 254
#define TX_MAX_PWR 23
#define TX_MIN_PWR 5
#define TX_MAX_PWR 20
#define TX_MIN_PWR 2

const float frequency = FREQUENCY; // Radio transmit frequency (depends on module in use and legislation)
#ifdef ENCRYPT_KEY
Expand Down Expand Up @@ -178,7 +178,7 @@ int16_t sensor2Value = 0;
int16_t sensor3Value = 0;

uint16_t batteryVoltage = 0;
uint8_t transmitPower = (TX_MIN_PWR + TX_MAX_PWR) / 4; // Set initial transmit power to low medium
int8_t transmitPower = ((TX_MAX_PWR - TX_MIN_PWR) / 4) + TX_MIN_PWR; // Set initial transmit power to low medium
uint8_t transmitPowerRaw = 25;


Expand Down
6 changes: 3 additions & 3 deletions SensorsGateway/SensorsGateway.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@


#define MAJOR_VERSION 1
#define MINOR_VERSION 4
#define MINOR_VERSION 5

#include <SimpleModbusAsync.h>
#include <RH_RF95.h>
Expand All @@ -100,8 +100,8 @@
#define SRAM_NSS 9

#define GATEWAYID 254 // Gateway ID in radio network, DO NOT CHANGE!
#define TX_MAX_PWR 23 // Radio dependant, this is for RFM95
#define TX_MIN_PWR 5 // Radio dependant, this is for RFM95
#define TX_MAX_PWR 20 // Radio dependant, this is for RFM95
#define TX_MIN_PWR 2 // Radio dependant, this is for RFM95
#define MAX_PAYLOAD_BUF 50 // This needs to be at least 50 to be on the safe side!
#define PULSE_MIN 1000 // How many ms between pulses at least
#define EEPROM_SAVE 3600000 // How often in ms to save pulse values to EEPROM
Expand Down
8 changes: 4 additions & 4 deletions SensorsPulse/SensorsPulse.ino
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
*/


#define VERSION 3
#define VERSION 4

#if defined NODE_TYPE_MULTICAL
#include <SimpleModbusAsync.h>
Expand Down Expand Up @@ -116,8 +116,8 @@
#endif

#define GATEWAYID 254
#define TX_MAX_PWR 23
#define TX_MIN_PWR 5
#define TX_MAX_PWR 20
#define TX_MIN_PWR 2
#define PULSE_MIN 1000
#define EEPROM_SAVE 3600000

Expand Down Expand Up @@ -159,7 +159,7 @@ bool isDebugMode = false;
volatile bool forceSend = false;
uint8_t nodeId; // Node ID

uint8_t transmitPower = (TX_MIN_PWR + TX_MAX_PWR) / 4; // Set initial transmit power to low medium
int8_t transmitPower = ((TX_MAX_PWR - TX_MIN_PWR) / 4) + TX_MIN_PWR; // Set initial transmit power to low medium
uint8_t transmitPowerRaw = 25;

volatile uint32_t pulse1 = 0;
Expand Down

0 comments on commit 8dcdf91

Please sign in to comment.