Like the classic simon game, this project has one of four LEDs blink and then will require the player to replicate the blinking LEDs by pressing one of the four associated buttons. After the player successfully replicates the order of the LED blinks, the program will add another blink to the order. It will keep adding more blinks until the players fails to replicate the order of the colored blinks.
This project uses the Quantum IoT platform that includes the Q-Server and Q-Client Builder Base
You can also find these instructions and more information about this project on our confluence project info page that is linked on this page.
Gather your Simon Says Kit PCB and all required components listed in the BOM.
It is especially important to follow the BOM exactingly as it tells you where to place the components on the PCB. The fifth column on the BOM is the “parts” column. This column designates which position on the PCB you need to place each component. For example, if under the parts column you have a resistor labeled r1 you would then find the position marked r1 on the PCB and place the resistor there.
Connecting the Builder Base
To connect the Simon Says PCB to the Builder Base you will need six male to male jumper wires and your flathead screwdriver.
Connect the PCB to the Builder Base as follows:
Note that there are two pairs of +5V and GND connections. Both pairs need to be connected to the Builder base. There are multiple GND ports on the Builder Base, but only one +5V port. We just double up the two wires in the one +5V port, but you could also splice the wire so that only one lead needs to make contact with the port.
Here is how the wiring should look once complete:
Build the Firmware
return [trigger+1, newDate()]
Here we will build one firmware file for all of the Simon Says components.
Using the toolbar located on the left hand side of the screen navigate to the firmware builder and then select “+ Create New” button to create a new firmware file.
Next, name your firmware file “Simon Says” and hit “Create”.
Now, click the “+ Add Hardware” button, and search for the device named “Button”.
Name your device. We suggest naming this one “Red”. Add four more buttons by repeating these steps and name them: Blue, Yellow, Green, and Reset.
To configure the “Red” button, click on it in the device list and select the “MCP23017” driver from the driver dropdown menu.
Pull Up: Disabled
Now, repeat these steps for the rest of the buttons. The only configuration that will change between them is the Channel selected for each. Here is a table for all of the button configurations:
With the buttons configured, let’s now add the LEDs. Again, click the “+Add Hardware” button, search for the LED device, and give it a name. Name the LED “Red LED”, and select the “Add Hardware” button.
Add three more LEDs by repeating these steps and name them: Green LED, Blue LED, and Yellow LED.
Click on the “Red LED” device and select the “MCP23017/8” driver under the driver dropdown menu.
For this driver we will select:
I2C Address: 0x27
Mode: Initially low
Now, repeat these steps for the rest of the LEDs. The only configuration that will change between them is the channel selected for each. Here is a table for all of the LED configurations:
With the configurations set you can now save and upload your firmware.