No Code Rock Paper Scisors
Welcome to the world of hands-on computer engineering! In this instructable, we'll build a unique twist on the classic game of Rock, Paper, Scissors. But here's the exciting part: no coding is required! Instead, we'll dive into hardware and circuitry to create a game that lights up rock, paper, or scissors without a single line of code. Get ready to explore the intersection of gaming and electronics in this fun and interactive project. Let's get started!
Supplies
- LED Matrix (How to make our own)
- A green LED
- A yellow LED
- A red LED
- 3 push buttons
- 4 4017 Decade Counters
- 2 555-timer chips
- 1 Quad OR gate chip
- 2 Quad NAND gate chips
- 1 NOT gate chip
- 3 Quad AND gate chips
- 2 1uf Capacitors
- 50 Diodes(I used a lot of PNP transistors instead of diodes)
- 17 330 ohm resistors
- 8 1k ohm resistors
- 3 520 ohm resistors
- 4 1/2 breadboards
Setting Up Your LED Matrix
- Line up Cathode and Anode Wires: Connect your LED matrix to the breadboard with the cathode (negative) and anode (positive) wires aligned neatly.
- Connect Cathodes to 330-Ohm Resistors: Take the cathode wires of the LED matrix and connect each one to a 330-ohm on the breadboard resistor. Ensure that each cathode is securely connected to its respective resistor.
- Connect Resistors to the Output of a NOT Gate: Now, connect the other end of each 330-ohm resistor to the output terminals of a NOT gate.
- Connecting the Anodes: If your images are going to be symmetrical, connect each Anode wire to its opposite Anode wire to save a lot of hassle later.
555 and Decade Counter Set UP
- Prepare the 555 Timer Astable Circuits: Set up your 555 Timer Astable Circuits using a 1uf capacitor, a 330 ohm resistor, and a 1k ohm resistor as shown to achieve the desired speed of the circuit.
- Position the Decade Counters: Place three-decade counters on the breadboard, ensuring they are spaced apart adequately to accommodate additional components. This strategic placement allows for efficient wiring and organization throughout the circuit.
- Establish Clock Enable and Clock Reset Connections:
- Connect the clock enable pins of each decade counter to ground, ensuring they are properly grounded to enable clock functionality.
- Connect the clock reset pins of the decade counters to ground through 1k ohm resistors.
- Connect the 555 Astable Timer Output to Decade Counter Clock Inputs:
- Take the output of the 555 timer astable circuit and connect it to the clock input of each decade counter.
1. Assign Outputs for Each Symbol:
- Utilize one output from each decade counter to represent a row of LEDs corresponding to a symbol (rock, paper, or scissors). Avoid using pin one of the decade counter outputs as it is vital that it is not used
2. Connect Cathodes and Anodes:
- For each symbol, connect the cathodes of the LED matrix to the outputs of the corresponding decade counter.
- Connect the anodes of the LED matrix to the same output as the corresponding cathode through diodes.
3. Diode Configuration for Anodes:
- If you connected the opposite anode wires earlier, you'll only need half the number of diodes for each anode. Adjust the diode configuration accordingly to match the wiring setup of your LED matrix.
4. Experiment with LED Matrix Designs:
- Use online LED matrix simulators to experiment with different designs and configurations before implementing them on your actual LED matrix. This step allows yo
5. Enable/Disable Decade Counters:
- To isolate and test individual symbols, connect the reset pin of the respective decade counter to power. This action effectively disables the counter, allowing you to focus on testing specific symbols without interference from others.
Randomizing Rock, Paper, or Scissors
1. Configure a New 555 Timer Astable Circuit:
- Set up another 555 timer astable circuit identical to the previous one, ensuring it generates the necessary timing for randomization.
2. Connect Output to the Randomizer Decade Counter:
- Take the output of the new 555 timer astable circuit and connect it to the clock input of a dedicated decade counter, referred to as the randomizer decade counter.
3. Utilize the Randomizer Decade Counter Outputs:
- Connect the output four from the randomizer decade counter to its own reset pin. This action ensures that the counter resets itself after reaching its fourth count, facilitating the randomization process.
4. Interconnect the Decade Counters:
- Connect the reset pins of the three symbol-decoding decade counters (rock, paper, scissors) to outputs one, two, and three of the randomizer decade counter, respectively, using diodes.
5. Diode Connections for Reset Pins:
- Connect each reset pin of the counters connected to the matrix to two output pins of the randomizer decade counter through diodes.
- One pin connects to the rock-and-scissors counters.
- One pin connects to the rock and paper counters.
- One pin connects to the scissors and paper counters.
6. Reset Mechanism:
- This configuration effectively turns off two of the decade counters while allowing the remaining counter to continue displaying its symbol on the LED matrix, based on the randomization determined by the randomizer decade counter.
1. Prepare Player Buttons with Resistors:
- Set up three buttons, each accompanied by a 10k ohm resistor connected to ground. This resistor configuration helps establish a stable voltage reference when the buttons are pressed.
2, Utilize an OR Gate Chip:
- Place an OR gate chip adjacent to the buttons.
3. Connect Button Outputs to OR Gate Inputs:
- Connect the output of each button to two inputs of the OR gate chip. Ensure that each button shares a gate on the chip with the other buttons.
4. Integrate Quad NOR Gates for SR Latches:
- Position two quad NOR gates next to the OR gate to create three SR latches.
- Connect each OR gate output to an input of an SR latch. Ensure that each OR gate is linked to only one SR latch.
5. Interconnect Button Outputs and SR Latches:
- Connect the output of each button to the SR latch that is not associated with the OR gate using that button's input.
- This setup ensures that when a button is pressed, its corresponding LED output turns on, while the outputs associated with other buttons turn off.
6. Test LED Outputs:
- Connect LEDs to the outputs of the SR latches to test their functionality. Verify that when a button is pressed, the LED corresponding to that button illuminates while the LEDs associated with other buttons remain off.
Win, Lose, or Draw
1. Position Quad AND Gate Chips:
- Place three Quad AND gate chips along the breadboard: one near the Randomizer Decade counter, one near the SR latches, and one in between them for convenient wiring.
2.Use Resistors for Ground Connections:
- Connect each Quad AND gate to ground using a 330 ohm resistor to regulate current when an output pin outputs low.
3.Assign Gates for Win, Loss, and Draw:
- Designate one Quad AND gate as the win gate, one as the loss gate, and one as the draw gate.
4.Connect Randomizer Decade Counter Outputs:
- Connect outputs one, two, and three of the randomizer decade counter to the input of a different gate on each Quad AND chip.
- Identify which output corresponds to rock, paper, or scissors, and assign each button as rock, paper, or scissors.
5. Link SR Latch Outputs to AND Gates:
- Connect the output of each SR latch to the inputs of the AND gates based on the game's logic.
- For example, connect the output of the rock SR latch to the same gate as the output of the randomizers scissors output on the win AND gate.
6. Setup LED Indicators:
- Install three LEDs: green (win), yellow (draw), and red (loss).
- Connect the cathode of each LED to ground using a 330 ohm resistor to limit current flow.
7. Connect Outputs of AND Gates to LEDs:
- Wire all outputs of the winning AND gate to the anode of the green LED through diodes.
- Connect all outputs of the drawing AND gate to the yellow LED through diodes.
- Route all outputs of the losing AND gate to the red LED through diodes.