ESP32 GPIO & PWM Quiz
ESP32 GPIO & PWM Quiz
Test your knowledge of ADC, LEDC PWM, touch pins, and interrupts. — 6 questions
About the ESP32 GPIO & PWM Quiz
Test your knowledge of ADC, LEDC PWM, touch pins, and interrupts. This quiz has 6 multiple-choice questions. Each question has one correct answer, and you see an explanation straight after you answer, so you learn from every question — including the ones you get wrong. There is no time limit and nothing to sign up for; your answers are not stored.
The questions follow the material in the GPIO & PWM on ESP32 guide and the ESP32 GPIO & PWM Cheatsheet. Read them first if you want to prepare, or take the quiz cold to find the gaps in what you know.
Questions in this quiz
Preview the questions below. Each answer and its explanation are hidden until you choose to reveal them, so you can still take the quiz above without spoilers.
1. What range of values does analogRead() return on the ESP32?
Show answer
Answer: C. 0߀“4095
The ESP32 ADC is 12-bit, giving 2^12 = 4096 steps (0߀“4095), compared to the Arduino Uno which is 10-bit (0߀“1023).
2. Why should ADC2 pins be avoided when WiFi is active?
Show answer
Answer: B. ADC2 shares hardware with the WiFi radio and cannot be used simultaneously
ADC2 hardware is shared with the WiFi radio. Attempting to use ADC2 while WiFi is on will cause an error or incorrect readings.
3. Which function do you use for PWM output on ESP32 (instead of analogWrite)?
Show answer
Answer: B. ledcWrite()
The ESP32 uses the LEDC peripheral for PWM. You set up a channel with ledcSetup(), attach a pin with ledcAttachPin(), and set duty with ledcWrite().
4. What attribute must be applied to an ISR function on the ESP32?
Show answer
Answer: C. IRAM_ATTR
IRAM_ATTR ensures the ISR is stored in IRAM (internal RAM) so it can execute even when the flash cache is busy.
5. Which GPIO pins have true DAC (analog voltage) output capability?
Show answer
Answer: A. GPIO 25 and 26
Only GPIO 25 and 26 have hardware DAC outputs on the ESP32, providing true analog voltage from 0 to 3.3 V.
6. What does a lower value from touchRead() indicate?
Show answer
Answer: B. A finger is touching the pin
Capacitive touch sensing reads charge time. A finger (which is conductive) reduces the reading ߀” lower value means a touch is detected.
How to use this quiz
- Answer every question before reading the explanations below — retrieving an answer from memory is what makes it stick.
- Note the questions you missed and revisit the matching section of the guide or cheatsheet.
- Retake the quiz a day or two later. Spaced repetition is one of the most reliable ways to remember technical details.