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)
March 15, 2021 at 11:00 am
#69440
Tobasco
Participant
Hi,
I solved my problem by replacing apply_all_station_bits()
with custom code to control the GPIO pins for the relays:
void OpenSprinkler::apply_all_station_bits() {
const uint8_t stationGPIO[] = {16, 14, 12, 13};
for (uint8_t i = 0; i < 4; i++) {
pinMode(stationGPIO[i], OUTPUT);
digitalWrite(stationGPIO[i], station_bits[0] & 1 << i ? HIGH : LOW);
}
}
salute
Thomas