This commit is contained in:
2026-06-08 06:37:22 -04:00
parent 6a120c9114
commit ed2ede6b19
3 changed files with 10 additions and 1 deletions

View File

@@ -3,7 +3,6 @@
# Lessons Learned # Lessons Learned
* I still don't trust C++ * I still don't trust C++
* How to drive an WS2812 RGB LED strip from the ESP32 using the Freenove library
* How the RMT peripheral on the ESP32-S3 works and why it is involved when driving WS2812 LED strs * How the RMT peripheral on the ESP32-S3 works and why it is involved when driving WS2812 LED strs
* How to select pin assignments on the ESP32 without relying on the tutorial * How to select pin assignments on the ESP32 without relying on the tutorial
* How to calibrate joysticks * How to calibrate joysticks
@@ -49,6 +48,16 @@ Up until now I've been using whatever pins the tutorial chose because, well, I h
<center><img alt="read the datasheet" width="320" src="readthedatasheet.jpg"/></center> <center><img alt="read the datasheet" width="320" src="readthedatasheet.jpg"/></center>
When you're following tutorials it's easy to assume "Pin X does Y thing because that's what the tutorial connected me to", and it's especially easy to think "Pin X **only** does Y thing", or "You **always** do Y thing with Pin X". This is almost never true. Each microcontroller has a datasheet from the manufacturer that tells you what all the different pins on the MCU do. The particular dev board you're using should also have a datasheet (or at least a pinout) that shows how the dev board maps all of the microcontroller pins to the devboard pins. Using these references will show you that, in fact, you can just lots of pins for lots of different functions, and that depending on how the chip is set up, a given pin may be overloaded with several different features - and that these usually can't be used together at the same time.
For example, here is the Freenove ESP32-S3 WROOM pinout from Freenove, the manufacturer of the dev board I'm using
<center><img alt="Freenove ESP32-S3 WROOM pinout" src="wroompinout.png" width="800px" /></center>
And here is some of the pin reference documentation from Espressif on the ESP32-S3 chip itself that lives on the devboard
<center><img alt="Espressif ESP32-S3 pinout" src="esp32s3pinout.png" width="480px" /></center>
## WS2812s ## WS2812s
The WS2812 is a series of LEDs on a strip, which can be controlled by sending a compact stream of data to the strip, and each LED takes its own data before forwarding on the rest. This allows you to control each LED individually in a theoretically endless string of LEDs with very little hardware overhead. In the particular example here, the WS2812 strip is arranged as an octagon of LEDs on a square PCB package with one `V+` line, one `GND` line, and one `S`(ignal) line. The WS2812 is a series of LEDs on a strip, which can be controlled by sending a compact stream of data to the strip, and each LED takes its own data before forwarding on the rest. This allows you to control each LED individually in a theoretically endless string of LEDs with very little hardware overhead. In the particular example here, the WS2812 strip is arranged as an octagon of LEDs on a square PCB package with one `V+` line, one `GND` line, and one `S`(ignal) line.

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
06-joystick/wroompinout.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB