Question: This assignment is to create an electronic die using C + + . When a button is pressed, the die will be rolled and a
This assignment is to create an electronic die using When a button is
pressed, the die will be "rolled" and a new value will appear. The die roll will be
simulated by generating a random number
The die value can be represented by a grid of LED lights as follows:
Store the light pattern onoff for all six possible die rolls as an array. This
can be done as a represented as a matrix dimensional array
However, an easier way to think about this is as a element array
For example, the die roll of two looks like this
We can think each of the possible nine points on a grid
Each of these possible points can be thought of as an index in an array
ndex Wlues
Each position of the array will represent the state of the corresponding LED
high or LOW
Hint #: It will be easier to create another array to store the which Photon
pins correspond to each LED. Then you can use a for loop to quickly turn
lights on
Only use Void setup and void loop. Write this as if you were a c student
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
