onTime()function so that the parameter type of
int. (Though the
delayfunction can accept an
int, it is actually
defined as a function that accepts an
The maximum value of an
intis 32,767, whereas the maximum value of an
unsigned longis 4,294,967,295. Since
delayinterprets whatever number
is passed to it as time in milliseconds, the maximum delay that could be
achieved by calling
intvariable is just over 32 sec,
whereas the maximum delay that could be achieved by passing it an
unsigned longvalue is almost 50 days!
loopfunction so that it turns on the Red, Yellow, Green, and Yellow
lights in that order. There is no need to modify the
onTimefunction to achieve
onTimefunction so that it takes two “pin” parameters.
Then modify the statements in the
onTimefunction so that it turns on two LEDs
at once, and then turns the two LEDs off at once.
In order to use your new function, you will also need to modify the statements
loopfunctio that invoke the
init()function so that just after it initializes each output pin,
it causes all 3 LEDs to turn on for a very brief period of time, e.g., 10 msec,
and then turn off.
init()again so that instead of incorporating the changes described
above, it calls another function to execute this high-speed blink.