[go: up one dir, main page]

0% found this document useful (0 votes)
7 views1 page

Loops Example1

Uploaded by

y2901773
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Loops Example1

Uploaded by

y2901773
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

REM Example while loop - blink LED 42 timesVAR $FOO = 42WHILE ( $FOO > 0 ) LED_G

DELAY 500 LED_OFF DELAY 500 $FOO = ( $FOO - 1 )END_WHILELED_R

REM The variable $FOO is set to 42.REM The WHILE loop begins, evaluating the
condition "is $FOO greater than 0".REM Every time the condition is TRUE, the block
of code between WHILE and END_WHILE will run.REM The LED will blink green: half a
second on, half a second off.REM The variable $FOO will decrement by one.REM Once
$FOO reaches zero, the WHILE condition will no longer evaluate to TRUE. The payload
will continue execution after the END_WHILE statement, where the LED will light
red.REM If the button is pressed at any time during the payload execution, the
WHILE loop will end and the USB Rubber Ducky will enter ATTACKMODE STORAGE since
that is the default behavior when no BUTTON_DEF has been initiated.

You might also like