Загрузка...

ESP32-C3 small project, Pomodo time bar shrinking and encoder control

This project uses an ESP32-C3 SuperMini, a 0.91" OLED display (128×32), and an EC11 rotary encoder to create a minimalist Pomodoro timer.

Turning the encoder fills or reduces a horizontal progress bar on the OLED. After 2 seconds of inactivity, the bar flashes and then shrinks automatically, ending with a "Done!" message.

The timer was built using Arduino with the U8g2 and Encoder libraries. Code was developed and refined with help from ChatGPT, acting as a real-time programming assistant.

====================================================================

Prompt Used for the code generation:
I have an ESP32-C3 SuperMini development board, a 0.91" OLED display (128x32, I2C interface), and an EC11 rotary encoder (without a soldered push button, but can be wired).

I want to implement a Pomodoro timer prototype using Arduino code with the following behavior:

When rotating the EC11 encoder clockwise, the OLED screen displays a horizontal progress bar from left to right, increasing one block (e.g., 8 pixels wide) per tick.

When rotating counterclockwise, the progress bar shortens from the right side, decreasing one block per tick.

If no interaction occurs for 2 seconds, the progress bar flashes 5 times (turning on and off), and then it shrinks automatically from right to left, removing one block per second.

When the bar is fully cleared, the screen displays “Done!” centered.

During the animation, the bar should occupy the full vertical height (32 pixels) of the screen for a strong visual effect.

This is a test mode, so each step corresponds to 1 second per block, and the encoder tick maps to 8 pixels horizontally.

Please use the U8g2 graphics library for the OLED and the Encoder library for the rotary encoder. Use GPIO2 and GPIO3 for the encoder A/B phase. Use GPIO8 GPIO9 for OLED I2C SDA and SCL signals.

Видео ESP32-C3 small project, Pomodo time bar shrinking and encoder control канала Raynolds
Яндекс.Метрика

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять