/// mussel2 - mussel voter influenced by time /// /// SPDX-License-Identifier: GPL-3.0-or-later /// SPDX-FileCopyrightText: 2025 Jonas Smedegaard #define DEVICE_NAME "Cycles of five good then one bad" void setup() { Serial.begin(115200); Serial.println(); Serial.println("Initializing..."); Serial.flush(); Serial.printf("Device ready: %s", DEVICE_NAME); } void loop() { String msg = "good"; if (read() >= 9) msg = "bad"; Serial.printf("*** NOTIFY: %s ***\n", msg); delay(1000); } byte read() { // Get second-long cyclic counter 0-11 unsigned long currentTime = millis(); unsigned long totalSeconds = currentTime / 1000; unsigned long currentSecond = totalSeconds % 12; return (byte)currentSecond; }