This article is about using the _thread class with an ESP32 microcontroller with 2 cores. However, the thread class is a subset of the cython module and at the time of writing it is not yet fully available. The class structure is as shown in Figure 1 and the LockType subclass is as shown in Figure 2.
Random numbers in Python use the random class, but microcontrollers don’t support as much randomness as in computer systems, so Micropython supports different commands depending on the chip type. This article discusses how to use random with esp8266 and esp32 microcontrollers, which are instructed to just generate random numbers and configure the random seed as follows.
This article takes a detailed look at the Micropython machine.RTC class. The main function of this class is designed to be an RTC (Real-Time Clock) inside the microcontroller for storing date and time. It is more convenient when used with ESP8266 or ESP32 chip because NTP can be accessed to read the date and time from the internet and then store the value into the RTC to enable the accuracy and do not require frequent internet access to read the values again. This saves the use of external RTC circuits as well.
From the previous article, we have tried writing a program to study the elements of various files that we need, we found that there are quite a lot of details and steps. But it is an important basis for those who want to seriously and usefully study Cortex-M0 programming via STM32F030F4P6 (Figure 1), Cortex-M3 with STM32F103C (Figure 32) and Cortex-M4 with STM32F401CCU6 (Figure 27) to study of programming structure with programming tool STM32CubeIDE (Figure 2), which is the main tool used in this series of articles. This is because it combines ST’s complete development kit for ARM, including CubeMX for chip design, compiler toolkit, ST-Link program debugging tool and code editor in one tool, plus it supports both Windows, Linux and macOS operating systems.
This article is a tutorial on how to use esp and esp32 classes, which are dedicated classes for esp8266 and esp32 microcontrollers to access specific features and the internal abilities of the two chips.