使用寄存器使单个 LED 闪烁。
Watch the video to learn how to use registers. Registers are specific locations in a microcontroller's memory. Each register is made up of individual bits that can be either 1 or 0. Many registers have special functions related to the microcontroller's hardware – for example, the Arduino's digital I/O pins. As explained in the video and slideshow, there are registers you can use to replace the pinMode() and digitalWrite() commands in your Arduino code. This approach lets you control up to 8 LEDs with a single line of code.
观看视频以了解如何使用寄存器。寄存器是微控制器内存中的特定位置。每个 register 由可以是 1 或 0 的单个位组成。许多寄存器具有与微控制器硬件相关的特殊功能,例如 Arduino 的数字 I/O 引脚。如视频和幻灯片中所述,您可以使用寄存器来替换 Arduino 代码中的 pinMode() 和 digitalWrite() 命令。这种方法允许您使用一行代码控制多达 8 个 LED。