aboutsummaryrefslogtreecommitdiff
path: root/mussel1/mussel1.ino
blob: 679e22562a8b0b01861b103325e717989f1e66be (plain)
  1. /// mussel1 - 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 "Current second is below 50"
  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 the current second (0-59)
  16. unsigned long currentTime = millis();
  17. unsigned long totalSeconds = currentTime / 1000;
  18. unsigned long currentSecond = totalSeconds % 60;
  19. String msg = "good";
  20. if (currentSecond >= 50)
  21. msg = "bad";
  22. Serial.printf("*** NOTIFY: %s ***\n", msg);
  23. delay(1000);
  24. }