O'Reilly logo

C Programming for Arduino by Julien Bayle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating your own LED-array library

We are going to create a very small library and test it with a basic circuit including six LEDs that are not multiplexed.

Wiring six LEDs to the board

Here is the circuit. It basically contains six LEDs wired to Arduino:

Wiring six LEDs to the board

Six LEDs wired to the board

The circuit diagram is shown as follows:

Wiring six LEDs to the board

Another diagram of the six LEDs wired directly to Arduino

I won't discuss the circuit itself, except to mention that I put in a 1 kΩ resistor. I took the worst case where all LEDs would be switched on at the same time. This would drive ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required