I've seen https://www.youtube.com/watch?v=5v6zZLt-e-4/snake game
https://www.theengineeringprojects.com/2023/04/iot-based-smart-home-automation-using-esp32.html
I’ve experimented with a similar setup using RTOS-based IoT devices, and one pattern that works well is structuring the system around producer–consumer threads. For instance, the temperature sensor thread can act as the producer, pushing readings into a message queue, while an MQTT thread consumes that data and publishes it to Home Assistant.
A possible layout could be:
- Sensor thread – polls the temperature every few seconds and pushes data to a queue
- Control thread – decides whether to toggle relays based on the setpoint
- Network/MQTT thread – manages Wi-Fi connectivity and publishes/subscribes to topics
- UI/display thread – updates the screen without blocking other operations
Ask Best Practices for Building a Smart Thermostat with RT-Thread and MQTT?