Cube Puzzle
Overview
This project is a whimsical rendition of the classic game Tetris. We hope it could be entertaining where you could find memories and find fun. We designed three blocks of different shapes. After placing them in the slotted base to fill the rows in the predetermined order, the blocks blinkered, and the light on the base changed and play the Tetris theme.
System Diagram
Our project designed a total of three different shaped blocks and one base. These blocks all have a Feather, a battery, a plate that holds the Feather and battery, a USB Extender Bracket for charging, and a switch. At the same time as there is a contact on the surface that snap fits the base. In the base, a total of five contact points are set, and a circuit playground express, a battery, a power switch, and a charger for charging the battery are placed inside.
Implementation
Each block can be inserted into the base slot well through snap-fit. Regardless of which block is inserted into the base slot, the block will receive a signal provided by the base circuit board through the contact point, thereby changing the light effect. However, only when the three boards are inserted into the slots in the order of characteristics, the base circuit board will receive signals from the three boards simultaneously. The base changes light effects and plays music.
What I do
Schematics Layouts
To make the code easier to understand, here is the explanation for our circuit. Circuit playground express (CPE) keep sending a high signal from pin A0, no matter blocks/feathers connect with which male contract, the feathers pin A1 will receive signal and make LED start to blink. Feathers keep sending a high signal from their pin 4, only male contract no.1, no.4, no.5 contract are active. When L shape connects with CPE pin A1, Z shape connect with CPE pin A4, and T shape connects with CPE pin A5 at the same time, the CPE will change LED and play music.
Software Development
We use three feathers, and one circuit playground express in our project. The three feathers use the same code developed in Arduino IDE, and the circuit playground express code generated on Microsoft Makecode.
3D modeling
In order to prevent the battery from falling when shaking the blocks or inserting the blocks too hard, I let the top of the retaining clip slightly protrude a bit to better fix it. Use interference fit to hold the feathers. Each plate includes 5 parts, which are the main plate and 4 peds. These four feet are interference fit pillars that will be inserted into the main plate in the opposite direction for holding the Feather.
Code
Here are some code screenshots