From 110bd494072684638a3d512b325d72aeeab9592c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Mon, 16 Jun 2025 19:51:53 +0100 Subject: [PATCH] VBAT schematic --- src/helpers/rp2040/WaveshareBoard.cpp | 3 ++- src/helpers/rp2040/WaveshareBoard.h | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/helpers/rp2040/WaveshareBoard.cpp b/src/helpers/rp2040/WaveshareBoard.cpp index 12e3d4f1..2e622933 100644 --- a/src/helpers/rp2040/WaveshareBoard.cpp +++ b/src/helpers/rp2040/WaveshareBoard.cpp @@ -16,7 +16,8 @@ void WaveshareBoard::begin() { #endif #if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL) - Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL); + Wire.setSDA(PIN_BOARD_SDA); + Wire.setSCL(PIN_BOARD_SCL); #endif Wire.begin(); diff --git a/src/helpers/rp2040/WaveshareBoard.h b/src/helpers/rp2040/WaveshareBoard.h index 492d54df..a09c4b62 100644 --- a/src/helpers/rp2040/WaveshareBoard.h +++ b/src/helpers/rp2040/WaveshareBoard.h @@ -18,10 +18,20 @@ #define SX126X_DIO2_AS_RF_SWITCH true #define SX126X_DIO3_TCXO_VOLTAGE 0 -// This board has no built-in way to read battery voltage -// #define PIN_VBAT_READ 26 -// #define BATTERY_SAMPLES 8 -// #define ADC_MULTIPLIER (3.1 * 3.3 * 1000) // MT Uses 3.1 +/* + * This board has no built-in way to read battery voltage. + * Nevertheless it's very easy to make it work, you only require two 1% resistors. + * + * VSYS -- /\/\/\/\-- --+ + * 200k | + * +-- GPIO28 + * | + * GND -- /\/\/\/\-- --+ + * 100k + */ +#define PIN_VBAT_READ 28 +#define BATTERY_SAMPLES 8 +#define ADC_MULTIPLIER (3.0f * 3.3f * 1000) class WaveshareBoard : public mesh::MainBoard { protected: