A 7-Segment Display consists of eight individual LEDs (seven bar segments named A through G, plus a decimal point DP) arranged in a figure-8 pattern. It is widely used to display numeric digits 0 through 9 and simple status characters.
1. Hardware Specifications & Segment Topology
- Operating Voltage: ~2.0V to 3.2V per segment, depending on LED color (see the color note in Section 6). Requires a
220Ω-class series resistor per segment line. - Display Configuration (
commonType): This component supports both wiring conventions, switchable via a Property Inspector setting (Section 3) — a real prop, not just documentation:- Common Cathode (CC) — default: all 8 LED cathodes tied to the COM pin(s), wired to GND. Driving a segment pin HIGH turns that segment ON.
- Common Anode (CA): all 8 LED anodes tied to the COM pin(s), wired to VCC. Driving a segment pin LOW turns that segment ON.
- Pin Configuration — a real 10-pin, 5×2 breadboard-style header, with the two COM pins internally bridged to the same net (wire either one, both are electrically identical):
- Top row (left→right): G, F, COM, A, B
- Bottom row (left→right): E, D, COM, C, DP
── A ──
│ │
F B
│ │
── G ──
│ │
E C
│ │
── D ── [DP]
2. How it Works (8-Bit Segment Mapping Tables)
Digits 0 through 9 are formed by lighting specific combinations of segments (this table is always in Common-Cathode "1 = segment ON" terms — invert every bit if wired Common Anode):
| Digit | Segment Pattern (A B C D E F G DP) | Bit String | Hex Byte |
|---|---|---|---|
| 0 | A, B, C, D, E, F ON | 11111100 | 0xFC |
| 1 | B, C ON | 01100000 | 0x60 |
| 2 | A, B, D, E, G ON | 11011010 | 0xDA |
| 3 | A, B, C, D, G ON | 11110010 | 0xF2 |
| 4 | B, C, F, G ON | 01100110 | 0x66 |
| 5 | A, C, D, F, G ON | 10110110 | 0xB6 |
| 6 | A, C, D, E, F, G ON | 10111110 | 0xBE |
| 7 | A, B, C ON | 11100000 | 0xE0 |
| 8 | All segments A–G ON | 11111110 | 0xFE |
| 9 | A, B, C, D, F, G ON | 11110110 | 0xF6 |
3. Component Properties (Property Inspector)
- Common Type (
commonType): Switches the simulated wiring convention (Section 1).- Default:
common-cathode - Options:
common-cathode(COM → GND),common-anode(COM → VCC)
- Default:
- LED Color (
onColor): The lit-segment color — any hex value, not a fixed enum.- Default:
#ff0000
- Default:
- Segment Off (
offColor): The unlit-segment color.- Default:
#ffffff
- Default:
- Max Current (
maxCurrent): Rated maximum current per segment — exceeding this by 50% trips an OVERCURRENT fault.- Default:
20mA - Range:
10mA to50mA
- Default:
[!NOTE] There's no "Displayed Digit" property — you can't set the digit directly in the Property Inspector. What's shown is always driven by the real simulated current through each segment (see Section 6), which the Blockly blocks below control by writing to the segment pins, exactly like on real hardware.

