/// mussel1 - mussel voter influenced by time /// /// SPDX-License-Identifier: GPL-3.0-or-later /// SPDX-FileCopyrightText: 2025 Jonas Smedegaard #define MUSSEL_ATTITUDE "closed 10 seconds every 50 seconds" void setup() { Serial.begin(115200); Serial.printf("\n\nDevice ready: %s\n", MUSSEL_ATTITUDE); } void loop() { Serial.printf("gap:%d\n", read()); delay(1000); } byte read() { // return 42 if current second modulo 60 is below 50, else 2 return (byte) (((unsigned long)millis() / 1000) % 60) < 50 ? 42 : 2; }