OpenSprinkler Forums OpenSprinkler Unified Firmware Change Firmware to control stations directly via GPIO pins (relays) Reply To: Change Firmware to control stations directly via GPIO pins (relays)

#75129

vamp
Participant

@Tobasco

I think that try this FW on 8 relay board. If i change this, is enough?

From:


#if defined(ESP8266)
if (ESP12F_RELAY_X4) {
// On the ESP12F_Relay_X4 board the relays for station 1...4 are connected to GPIO 16, 14, 12 and 13:
const uint8_t stationGPIO[] = {16, 14, 12, 13};
for (uint8_t i = 0; i < 4; i++) {
pinMode(stationGPIO[i], OUTPUT);
bool isActive = station_bits[0] & (1 << i);
digitalWrite(stationGPIO[i], isActive ? HIGH : LOW);
}
return;
}

To:


#if defined(ESP8266)
if (ESP12F_RELAY_X8) {
// On the ESP12F_Relay_X8 board the relays for station 1...8 are connected to GPIO 16, 14, 12, 13, 15, 0, 4 and 5:
const uint8_t stationGPIO[] = {16, 14, 12, 13, 15, 0, 4, 5};
for (uint8_t i = 0; i < 8; i++) {
pinMode(stationGPIO[i], OUTPUT);
bool isActive = station_bits[0] & (1 << i);
digitalWrite(stationGPIO[i], isActive ? HIGH : LOW);
}
return;
}

The Board:

https://templates.blakadder.com/ESP12F_Relay_X8.html