counter-reset
(C)stachan 08.02.2024
Task :: Counter Reset
Schreiben Sie ein Programm, das die LEDs in einer Endlosschleife nach dem folgenden Muster blinken lässt: Rot lang - gelb 4x kurz - grün 2x lang, wobei lang = 900ms, kurz = 300ms.
Benutzen Sie Schleifen.
Parallel läuft ein Zähler mit, der die Komplettdurchläufe des Programms zählt. Am Ende jeder Runde wird der Text „times the program ran:“ ausgegeben, dazu der aktuelle Zählerstand.
Wenn der rote Button geklickt wird, erscheint der Text „RESET SUCCESSFUL“ und der Rundenzähler wird zurückgesetzt. Währenddessen darf keine der LEDs leuchten.
Write a program that makes the LEDs flash in an endless loop according to the following pattern: Red long - yellow 4x short - green 2x long, where long = 900ms, short = 300ms.
Use loops.
Simultaneously a counter is running, which counts the complete runs of the program. At the end of each cycle the text “times the program ran:” is displayed, together with the current counter reading.
When the red button is clicked, the text “RESET SUCCESSFUL” appears and the counter is reset. None of the LEDs must be lit during this process.