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 C++. 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 1-6
The die value can be represented by a 33 grid of LED lights as follows:
Store the light pattern (on/off) for all six possible die rolls as an array. This
can be done as a represented as a 33 matrix (2 dimensional array).
However, an easier way to think about this is as a 9-element array
For example, the die roll of two looks like this
We can think each of the possible nine points on a 33 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 #1: It will be easier to create another array to store the which Photon 2
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
This assignment is to create an electronic die

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!