Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hak5
GitHub Repository: hak5/usbrubberducky-payloads
Path: blob/master/payloads/examples/Loops/Loops-example3.txt
2971 views
1
REM Example Infinite Loop
2
BUTTON_DEF
3
WHILE TRUE
4
LED_R
5
DELAY 500
6
LED_OFF
7
DELAY 500
8
END_WHILE
9
END_BUTTON
10
WHILE TRUE
11
LED_G
12
DELAY 500
13
LED_OFF
14
DELAY 500
15
END_WHILE
16
17
18
REM Because a button definition has been initiated with BUTTON_DEF, the default behavior will no longer apply when the button is pressed.
19
REM The LED will blink green: half a second on, half a second off.
20
REM Pressing the button will stop the currently infinite loop of blinking the LED green and execute the button definition, thus blinking the LED red.
21