This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
charlieplexing_on_the_esp32 [2020/09/01 11:17] 49.181.161.176 Typo fixes, thanks Adam! |
charlieplexing_on_the_esp32 [2020/09/01 22:04] 49.180.4.219 |
||
---|---|---|---|
Line 46: | Line 46: | ||
Let's build this onto the breadboard. The wiring is fairly simple so the breadboard layout is: | Let's build this onto the breadboard. The wiring is fairly simple so the breadboard layout is: | ||
- | [] | + | {{ :charlieplexing:esp32-led-breadboard-charlie-2-pin.png |}} |
The following code would allow them to alternate: | The following code would allow them to alternate: | ||
Line 106: | Line 106: | ||
Notice there are now two groups of two LEDs, plus two more bridging across at the bottom. This arrangement lets us use lots of pin mode combinations to get all the LEDs to light up one at a time. | Notice there are now two groups of two LEDs, plus two more bridging across at the bottom. This arrangement lets us use lots of pin mode combinations to get all the LEDs to light up one at a time. | ||
- | We'll start by looking at what is needed to light LED1. If we set pin 21 to be ''OUTPUT'' and ''HIGH'' to supply voltage, and on pin 22, we set to ''OUTPUT'' and ''LOW'' to act as ''GND'', then we can be pretty sure that current will happily flow on that path and LED1 will light up. | + | We'll trace the schematic to see what is needed to light LED1. If we set pin 21 to be ''OUTPUT'' and ''HIGH'' to supply voltage, and on pin 22, we set to ''OUTPUT'' and ''LOW'' to act as ''GND'', then we can be pretty sure that current will happily flow on that path and LED1 will light up. |
But what about pin 23? What's happening with this one? What do we set this to? We don't really want this pin to supply any voltage. Do we want it to be ''GND'' too? | But what about pin 23? What's happening with this one? What do we set this to? We don't really want this pin to supply any voltage. Do we want it to be ''GND'' too? | ||
Line 130: | Line 130: | ||
Therefore, there is only enough voltage to power LED1. | Therefore, there is only enough voltage to power LED1. | ||
- | What about powering LED4? How do we determine the INPUTs and OUTPUTs here? I find it helpful to start tracing the schematic: | + | What about powering LED4? How do we determine the INPUTs and OUTPUTs here? We'll trace the schematic again: |
Voltage should be supplied on pin 23 as ''OUTPUT'' and ''HIGH'', and pin 22 should be ''OUTPUT'' and ''LOW'' to provide ground. That will give the most obvious current path. | Voltage should be supplied on pin 23 as ''OUTPUT'' and ''HIGH'', and pin 22 should be ''OUTPUT'' and ''LOW'' to provide ground. That will give the most obvious current path. |