Hi all, i'm wondering without specific driver like TM1637, can i control each digit on 4x7 segment display just by gpio?
Currently, my 4x7 segment is cathode one and i don't have enough gpio on ESP8266 so i just test 2 digits (D1, D2) on the 4x7.
I have wired up all segment (a->g) and D1, D2 (through 1k resistors) to available gpio pins. When i set high value (1) to a->f and low value (0) on D1, D2, both D1, D2 appear as 0. Is there any way to isolate the digits? for example D1 is 0 but D2 is 9, seem like with this setup, if i set one, both digit appear to be the same.
ESP8266 4x7 segment display
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: ESP8266 4x7 segment display
The general solution is multiplexing, where you show each digit in turn for a brief period. If this is done sufficiently fast, the eye sees them as permanently illuminated. However for four digits this requires 11 GPIO pins. The ESP8266 has just 11 I/O pins, but some have specific requirements and two are used for your USB connection. So without some external electronics I don't think this can be done.
You can buy devices with more I/O or displays which require fewer I/O pins.
You can buy devices with more I/O or displays which require fewer I/O pins.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 2
- Joined: Fri Jan 01, 2021 2:12 am
Re: ESP8266 4x7 segment display
Thanks for the keyword, i think i got the point here.
Re: ESP8266 4x7 segment display
The TM1637 driver is just for common anode displays.
MAX7219 can be used to drive both common cathode (normal) and common anode (reverse).
Here's how you can wire it in either direction.
If you just want more IOs, have a look into using an IO expander: MCP23008, MCP23017, PCF8574, PCF8575
Other LED drivers worth looking into: HT16K33, SX1509, TM1638, TM1640
There's MicroPython drivers for all of these, listed here.
MAX7219 can be used to drive both common cathode (normal) and common anode (reverse).
Here's how you can wire it in either direction.
If you just want more IOs, have a look into using an IO expander: MCP23008, MCP23017, PCF8574, PCF8575
Other LED drivers worth looking into: HT16K33, SX1509, TM1638, TM1640
There's MicroPython drivers for all of these, listed here.