Fix I2C address to 0x77 for BMP280

This commit is contained in:
norbert-walter 2024-04-19 13:04:03 +02:00
parent ca7b145507
commit cae53f7dc0
3 changed files with 13 additions and 17 deletions

View File

@ -57,9 +57,6 @@ GxEPD2_BW<GxEPD2_420_SE0420NQ04, GxEPD2_420_SE0420NQ04::HEIGHT> & getdisplay(){r
// Horter I2C moduls // Horter I2C moduls
PCF8574 pcf8574_Out(PCF8574_I2C_ADDR1); // First digital output modul PCF8574 from Horter PCF8574 pcf8574_Out(PCF8574_I2C_ADDR1); // First digital output modul PCF8574 from Horter
// RTC DS1388
RTC_DS1388 ds1388;
// Define the array of leds // Define the array of leds
CRGB fled[NUM_FLASH_LED]; // Flash LED CRGB fled[NUM_FLASH_LED]; // Flash LED
CRGB backlight[NUM_BACKLIGHT_LED]; // Backlight CRGB backlight[NUM_BACKLIGHT_LED]; // Backlight
@ -76,10 +73,6 @@ void hardwareInit()
// Init power rail 5.0V // Init power rail 5.0V
setPortPin(OBP_POWER_50, true); setPortPin(OBP_POWER_50, true);
// Init E-Ink display
//getdisplay().init(115200, true, 2, false); // Use this for Waveshare boards with "clever" reset circuit, 2ms reset pulse
// Init RGB LEDs // Init RGB LEDs
FastLED.addLeds<WS2812B, OBP_FLASH_LED, GRB>(fled, NUM_FLASH_LED); FastLED.addLeds<WS2812B, OBP_FLASH_LED, GRB>(fled, NUM_FLASH_LED);
FastLED.addLeds<WS2812B, OBP_BACKLIGHT_LED, GRB>(backlight, NUM_BACKLIGHT_LED); FastLED.addLeds<WS2812B, OBP_BACKLIGHT_LED, GRB>(backlight, NUM_BACKLIGHT_LED);
@ -89,14 +82,6 @@ void hardwareInit()
if(pcf8574_Out.begin()){ // Initialize PCF8574 if(pcf8574_Out.begin()){ // Initialize PCF8574
pcf8574_Out.write8(255); // Clear all outputs pcf8574_Out.write8(255); // Clear all outputs
} }
// Init DS1388 RTC
if(ds1388.begin()){
uint year = ds1388.now().year();
if(year < 2023){
ds1388.adjust(DateTime(__DATE__, __TIME__)); // Set date and time from PC file time
}
}
} }
void setPortPin(uint pin, bool value){ void setPortPin(uint pin, bool value){

View File

@ -8,11 +8,11 @@
#define OBP_I2C_SDA 47 #define OBP_I2C_SDA 47
#define OBP_I2C_SCL 21 #define OBP_I2C_SCL 21
// DS1388 RTC // DS1388 RTC
#define DS1388_I2C_ADDR 0xD0 // Addr. 0xD0 #define DS1388_I2C_ADDR 0x00 // Addr. 0x00 (Range 0x00-0x0C)
// BME280 // BME280
#define BME280_I2C_ADDR 0x76 // Addr. 0x76 (0x77) #define BME280_I2C_ADDR 0x76 // Addr. 0x76 (0x77)
// BMP280 // BMP280
#define BMP280_I2C_ADDR 0x76 // Addr. 0x76 (0x77) #define BMP280_I2C_ADDR 0x77 // Addr. 0x76 (0x77)
// BMP085 / BMP180 // BMP085 / BMP180
#define BMP180_I2C_ADDR 0x77 // Addr. 0x77 (fix) #define BMP180_I2C_ADDR 0x77 // Addr. 0x77 (fix)
// SHT21 / HUT21 // SHT21 / HUT21

View File

@ -3,6 +3,7 @@
#include "Pagedata.h" #include "Pagedata.h"
#include "OBP60Hardware.h" // PIN definitions #include "OBP60Hardware.h" // PIN definitions
#include <Wire.h> // I2C connections #include <Wire.h> // I2C connections
#include <RTClib.h> // DS1388 RTC
#include <MCP23017.h> // MCP23017 extension Port #include <MCP23017.h> // MCP23017 extension Port
#include <N2kTypes.h> // NMEA2000 #include <N2kTypes.h> // NMEA2000
#include <N2kMessages.h> #include <N2kMessages.h>
@ -23,6 +24,9 @@
#include "OBP60QRWiFi.h" // Functions lib for WiFi QR code #include "OBP60QRWiFi.h" // Functions lib for WiFi QR code
#include "OBPSensorTask.h" // Functions lib for sensor data #include "OBPSensorTask.h" // Functions lib for sensor data
// RTC DS1388
RTC_DS1388 ds1388;
// Global vars // Global vars
bool initComplete = false; // Initialization complete bool initComplete = false; // Initialization complete
int taskRunCounter = 0; // Task couter for loop section int taskRunCounter = 0; // Task couter for loop section
@ -46,6 +50,13 @@ void OBP60Init(GwApi *api){
} }
else{ else{
// Init code for DS1388 // Init code for DS1388
api->getLogger()->logDebug(GwLog::LOG,"DS1388 found");
if(ds1388.begin()){
uint year = ds1388.now().year();
if(year < 2023){
ds1388.adjust(DateTime(__DATE__, __TIME__)); // Set date and time from PC file time
}
}
} }
// Init hardware // Init hardware