Book Image

Arduino BLINK Blueprints

By : Utsav Shah
Book Image

Arduino BLINK Blueprints

By: Utsav Shah

Overview of this book

Arduino is an open-source prototyping platform based on easy-to-use hardware and software. Arduino has been used in thousands of different projects and applications by a wide range of programmers and artists, and their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike. Want to build exciting LED projects with Arduino? This book will be your companion to bring out the creative genius in you. To begin with, you will get introduced to the maker movement and the open source hardware development Arduino boards. You will then move on to develop a mood lamp and a remote-controlled TV backlight. As you progress through the book, you will develop an LED cube and will learn to use sound visualization to develop a sound-controlled LED Christmas tree. You will then move on to build a persistence of vision wand. At the end of each chapter, you’ll see some common problems, their solutions, and some workarounds.
Table of Contents (14 chapters)

Programming a 4*4*4 LED cube


Having done the hard part of soldering, let's get into Arduino connection and programming. Before connecting the positive leads, connect four negative layers to Arduino analog I/O ports A2 (bottom layer) through A5 (top layer). After that, 16 LED control pins needs to be connected to the Arduino board. Connect the first 14 pins to Arduino digital I/O ports 0 to 13. The remaining pins 15 and 16 need to be connected to Analog pins A0 and A1. See the following diagram for connection reference:

There are a few things that you should understand before programming your cube:

  • To address a single LED use a plane (layer) number 0–3, and an LED pin number 0–15. Turn the plane to LOW output (negative leg) and the LED pin number to HIGH (positive leg) to activate the LED.

  • Before activating a single LED, ensure all other planes are off by setting them to HIGH output. If you don't do this, the whole column of LEDs will light up instead of a single LED.

Now you are all set to start...