An LED array is nothing but a few LEDs connected together. Usually, an LED array comes in sizes of eight LEDs and 16 LEDs. You can control an LED array directly using the
digitalWrite() function. Apart from using the
digitalWrite() function, you can control LEDs directly using port-level communication. On Arduino, we have three ports: ports B, C, and D:
Each port is controlled by three DDR registers. These registers are defined variables in Arduino as DDRB, DDRC, and DDRD. Using these variables, we can make the pins either as input or output in the setup function.
You can use the following syntax to initialize the pins:
DDRy = Bxxxxxxxx
Here, y is the ...