This is an old revision of the document!
It is advised to use timers that periodically execute a function to handle repeating tasks. Hardware timers work parallel to the CPU and consume few CPU resources. ESP32-S3 has 4 hardware timers, but each timer can execute multiple handlers.
The idea of using the timer is to encapsulate a piece of compact code that can be run virtually asynchronously and executed is a precisely-defined time manner. In this scenario, we use a timer to update the LCD screen periodically. We choose a dummy example where Timer 1 is used to increment a value of the byte
type, and Timer 2 reads this value and writes it on the LCD. Naturally, a collision may occur whenever two processes are to access a single memory block (variable). It is critical when both processes (tasks, asynchronous functions) are writing to it. However, in our example, the handler executed by Timer 1 only writes to the variable, while Timer 2 only reads from it. In this scenario, there is no need to use mutexes (semaphores). A scenario with detailed description of when to use mutexes is beyond the scope of this example.
Provide prerequisite hardware/software/software libraries/skills if other than stated in the Laboratory description. Refer to other laboratory scenarios that users should be aware of, i.e. presenting a network message on the LCD screen should not focus on the method of handling LCD; rather, refer to the scenario (training) on how to handle LCD display. If none, remove it along with the header. Please note some information may be common for all scenarios (i.e. connectivity credentials or MQTT library credentials), so provide it at the laboratory description level, not at the scenario level. It is essential for easy updates.
Describe a task to be implemented by the scenario user.
Write starting conditions, i.e. what to do in the beginning, what to pay attention to before beginning, how the mechanical part should look, etc. Include needed compiler configuration, etc.
Write some extra information if, i.e. some steps are optional; otherwise, cancel this paragraph (but do not remove the header).
Describe activities done in Step 1.
…
Describe activities done in Step n.
Provide some result validation methods for self-assessment.
This section is to be extended as new questions appear.
When using the printed version of this manual, please refer to the latest online version of this document to obtain the valid and up-to-date list of the FAQ.
Provide some FAQs in the following form:
Question?: Answer.