Browse Source

* RAK batt read (hopefully) fixed

pull/10/head
Scott Powell 1 year ago
parent
commit
78fe83f065
  1. 2
      examples/simple_repeater/main.cpp
  2. 8
      src/helpers/RAK4631Board.h

2
examples/simple_repeater/main.cpp

@ -19,7 +19,7 @@
/* ------------------------------ Config -------------------------------- */
#define FIRMWARE_VER_TEXT "v2 (build: 1 Feb 2025)"
#define FIRMWARE_VER_TEXT "v2 (build: 2 Feb 2025)"
#ifndef LORA_FREQ
#define LORA_FREQ 915.0

8
src/helpers/RAK4631Board.h

@ -19,8 +19,8 @@
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
// built-ins
#define PIN_VBAT_READ 1
#define ADC_MULTIPLIER 6.17
#define PIN_VBAT_READ 5
#define ADC_MULTIPLIER (3 * 1.73)
class RAK4631Board : public mesh::MainBoard {
protected:
@ -31,6 +31,8 @@ public:
// for future use, sub-classes SHOULD call this from their begin()
startup_reason = BD_STARTUP_NORMAL;
pinMode(PIN_VBAT_READ, INPUT);
pinMode(SX126X_POWER_EN, OUTPUT);
digitalWrite(SX126X_POWER_EN, HIGH);
delay(10); // give sx1262 some time to power up
@ -38,7 +40,7 @@ public:
uint8_t getStartupReason() const override { return startup_reason; }
#define BATTERY_SAMPLES 10
#define BATTERY_SAMPLES 8
uint16_t getBattMilliVolts() override {
analogReadResolution(12);

Loading…
Cancel
Save