From 9958e9a3b9e47ccde0e277c4da73783d887cc24a Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 28 May 2026 08:15:51 -0400 Subject: [PATCH] Change wording --- flowing_light_with_button/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowing_light_with_button/README.md b/flowing_light_with_button/README.md index 4bb98f7..1bd1e31 100644 --- a/flowing_light_with_button/README.md +++ b/flowing_light_with_button/README.md @@ -31,7 +31,7 @@ if (digitalRead(PIN_BUTTON) == LOW) { // do something with the pin ``` -... This is not great. First, we are wasting CPU cycles (The ESP32-S3 has an Xtensa dual-core 32-bit LX7 running up to 240Mhz - stunning when you think about the price and size of the package, but still, not enough to be wasteful). But on the ESP32-S3 in particular, the solution package as a whole isn't losing those cycles - it runs Arduino on top of an RTOS, so `delay()` is actually yielding back to the RTOS scheduler so that things like bluetooth and wifi stacks can continue. But *our* program is fully blocked here. If I want to scan additional buttons, or perform some other task, we're locked in here. So I improved that by using a timer in a function that yields time back to the CPU while it's waiting to verify that the button is debounced. +... This is not great. On simpler microcontrollers, `delay()` burns CPU cycles (The ESP32-S3 has an Xtensa dual-core 32-bit LX7 running up to 240Mhz - stunning when you think about the price and size of the package, but still, not enough to be wasteful). But on the ESP32-S3 in particular, the solution package as a whole isn't losing those cycles - it runs Arduino on top of an RTOS, so `delay()` is actually yielding back to the RTOS scheduler so that things like bluetooth and wifi stacks can continue. But *our* program is fully blocked here. If I want to scan additional buttons, or perform some other task, we're locked in here. So I improved that by using a timer in a function that yields time back to the CPU while it's waiting to verify that the button is debounced. ```arduino void checkButtonPressed(void) {