New SPI display SSD1309 for 4LD.

Fixed global I2C usage (no pin allocation in usermods).
Enabled option dor Multi relay.
This commit is contained in:
Blaz Kristan
2023-06-21 23:31:15 +02:00
parent c04c73bbd7
commit cf48ad06ed
10 changed files with 55 additions and 77 deletions

View File

@@ -113,8 +113,7 @@ private:
public:
void setup()
{
PinManagerPinType pins[2] = { { i2c_sda, true }, { i2c_scl, true } }; // allocate pins
if (!pinManager.allocateMultiplePins(pins, 2, PinOwner::HW_I2C)) return;
if (i2c_scl<0 || i2c_sda<0) { enabled = false; return; }
sensorFound = lightMeter.begin();
initDone = true;
}
@@ -174,7 +173,9 @@ public:
user = root.createNestedObject(F("u"));
JsonArray lux_json = user.createNestedArray(F("Luminance"));
if (!sensorFound) {
if (!enabled) {
lux_json.add(F("disabled"));
} else if (!sensorFound) {
// if no sensor
lux_json.add(F("BH1750 "));
lux_json.add(F("Not Found"));