Added INA219 sensor

This commit is contained in:
Luca Olivieri committed 2026-10-23 21:35:02 +02:00
1 parent e296c49580
commit ff4c28985c
5 files changed
+88 -2

No files matched your search

+12
View File
@@ -1,12 +1,19 @@
#include <Arduino.h>
#include <SPI.h>
#if ENV_INCLUDE_INA219
#include <Wire.h>
#endif
#include "target.h"
LilyGoT3STM32Board board;
RADIO_CLASS radio = new STM32WLx_Module();
WRAPPER_CLASS radio_driver(radio, board);
VolatileRTCClock rtc_clock;
#if ENV_INCLUDE_INA219
EnvironmentSensorManager sensors;
#else
SensorManager sensors;
#endif
DISPLAY_CLASS display;
// PH3 is also BOOT0: the board's button is active high with an external pull-down.
MomentaryButton user_btn(PIN_USER_BTN, 1000, false);
@@ -24,6 +31,11 @@ static const Module::RfSwitchMode_t rfswitch_table[] = {
void LilyGoT3STM32Board::begin() {
STM32Board::begin();
#if ENV_INCLUDE_INA219
// These builds remap Wire to PB7/PB8; PA9/PA10 are used by USART1.
Wire.begin();
#endif
// The SD card shares SPI1 with the OLED; keep it deselected.
digitalWrite(PA4, HIGH);
pinMode(PA4, OUTPUT);