So, all we have really done here is to move the four lines of code that flash the LED
from the middle of the
for
loop to be in a function of their own called
flash
. Now you can
make the LED flash any time you like by just calling the new function by writing
flash()
.
Note the empty parentheses after the function name. This indicates that the function does
not take any parameters. The delay value that
it uses is set by the same
Dostları ilə paylaş: