MicroBit Project #02 for INF 294
Project description:
Using code for MicroBit built in C/C++, activate each LED in the matrix at random until the matrix is fully lit. Clear the field and repeat on loop.
This problem was solved by C.Schultz.
Algorithm as follows:
Instantiate a MicroBit object
Assign variables for plotting LED values x(row), y(column)
In main method:
Initialize MicroBit
While the fiber is open
set a counter to zero
while the counter is less than 25 (number of possible LEDs)
generate random values to activate an LED
get the value of the next randomly picked LED and test if it is equal to 0
if true, set the brightness value to 255 and iterate the counter
if false, jump to top of loop without further action
when counter equals 25:
clear full matrix field
set counter to 0
outer loop is unending
https://os.mbed.com/users/tsfarber/code/microbit-2-dottedField/
Please log in to post comments.