DALE logoDALE

EXPERIMENT 03 • GETTING STARTED

🧠 Two Buttons, One Decision

2 TM1638 Keys → AND Gate → TM1638 LED

You know what an input does and what an output does. Now DALE will make a decision between them.

Beginner~10 minutesTM1638

What You'll Build

A project where two physical TM1638 keys must both be pressed before a TM1638 LED turns on. This is your first project where DALE makes a decision using a logic gate.

What You'll Need

  • DALE with ESP32-S3
  • TM1638 module from Experiments 01 and 02
TM1638 display, LED and pushbutton module
TM1638 display, LED and pushbutton module

What You'll Learn

  • What an AND gate does.
  • How two Boolean inputs combine into one decision.
  • Why AND is TRUE only when both inputs are TRUE.
  • How changing logic changes behavior without changing hardware.

Connect It

No new hardware is required. Keep the TM1638 connected exactly as it was in the first two experiments. This time we'll use two keys and one LED from the same module.

Try the Inputs First

Open the TM1638 Lab and press each of the two keys you plan to use. Confirm that DALE sees each key independently. Then test the LED you plan to use.

DALE habit: test the pieces first. When each piece works by itself, combining them is much easier to understand and troubleshoot.

Build It in Logic Builder

Add two TM1638 Key (TM Key) blocks and select two different physical keys. Add an AND block and one TM1638 LED (TM LED) block. Connect both TM1638 Key outputs to the two AND inputs, then connect the AND output to the TM1638 LED.

Try all four combinations: neither key pressed, Key A only, Key B only, and both pressed. The LED should turn on only when both keys are pressed.

What Just Happened?

An AND gate asks a very specific question: Are input A AND input B both TRUE? If either answer is FALSE, the result is FALSE. You have moved beyond simply connecting an input to an output—you are now creating a rule.

BUILD IT VISUALLY. SEE THE REAL CODE.

Show Me The Code

Find the readable variables for your two TM1638 Keys and the AND result. In Arduino/C++, AND is represented by &&. Compare the generated expression with the blocks you connected visually, then follow the result to the TM1638 LED output.

Try This Next

Replace AND with OR. Then try XOR. Keep the exact same TM1638 hardware and observe how changing only the logic changes the behavior. That is the power of separating hardware from logic.