September , 2022
Pulse-Width Modulation, or PWM for short, is a scheme that uses digital signals to simulate changes in analog signals, as most of the signals in our natural life are analog, such as brightness, speed, volume, etc.
Based on the hardware in the previous section, some of you will ask exactly how the LED lighting is achieved.
The answer is to use a GPIO peripheral.
Here you need to understand a concept, the full name of peripherals is external devices.
In the early days, UART, LCD controller, and so on, and the CPU is not on a chip, so that is called external devices.
Pico:ed is powered by the latest MCU release from the Raspberry Pi Foundation (RP2040), the first microcontroller for the Raspberry Pi. It brings our signature value of high performance, low cost and ease of use to the microcontroller space.
As we all know, ELECFREAKS recently developed a development board based on RP2040--Pico:ed. Compared with the official Pico, this board is more suitable for classroom use. It is similar to micro:bit's gold finger edge connector and is also compatible with all micro:bit kits developed by ELECFREAKS.
Often, without our eyes and ears, our hands and feet are not as accurate as they could be, because we get feedback through our eyes and ears. Our brain can use the feedback to constantly correct the movement of our hands and feet, creating closed-loop feedback. If we need to use PWM to precisely control the brightness of an LED, we need feedback, but the brightness of the LED is an analogue signal.
Our MCU is not able to process the analogue signal directly, it needs to be converted into a digital signal before it can be processed, so how can we convert the analogue signal into a digital signal? This is where Pico:ed's ADC function shines through.