aboutsummaryrefslogtreecommitdiff
path: root/mussel2/mussel2.ino
blob: a82fa2cdd6e5166fa7ab63311b2f1aee1332f5b7 (plain)
  1. /// mussel2 - mussel voter influenced by time
  2. ///
  3. /// SPDX-License-Identifier: GPL-3.0-or-later
  4. /// SPDX-FileCopyrightText: 2025 Jonas Smedegaard <dr@jones.dk>
  5. #define DEVICE_NAME "Cycles of five good then one bad"
  6. void setup() {
  7. Serial.begin(115200);
  8. Serial.println();
  9. Serial.println("Initializing...");
  10. Serial.flush();
  11. Serial.printf("Device ready: %s",
  12. DEVICE_NAME);
  13. }
  14. void loop() {
  15. // Get second-long cyclic counter 0-11
  16. unsigned long currentTime = millis();
  17. unsigned long totalSeconds = currentTime / 1000;
  18. unsigned long currentSecond = totalSeconds % 12;
  19. String msg = "good";
  20. if (currentSecond >= 9)
  21. msg = "bad";
  22. Serial.printf("*** NOTIFY: %s ***\n", msg);
  23. delay(2000);
  24. }