Skip to content

16 Edge LED TinyShield Tutorial

If you're looking to add some visualization to your project, the 16 Edge LED TinyShield provides a great way to display text, images, and other feedback across 16 LEDs coming in red, green, or amber.

This tutorial teaches the basics of using this TinyShield for various applications.

To learn more about the TinyDuino Platform, click here


Description

The 16 Edge LED TinyShield has 16 LEDs mounted around the edge of the board. The 16 LEDs are mounted around the outside of the board, and can easily be seen even when the LED board is in the middle of a TinyShield stackup These LEDs only use five signals from the TinyDuino using a technique called Charlieplexing, which saves the other I/O pins for other functions of your project.

To see what other TinyShields are compatible with this TinySheild, see the TinyShield Compatibility Matrix

Technical Details LED Specs
  • 16 Side Mounted LEDs around the edge of the board
  • Charlieplexed IO on 5 signals
  • Available in Green, Amber or Red
**TinyDuino Power Requirements**
  • Voltage: 3.0V - 5.5V
  • Current:
    • 1.5mA per LED (3.0V)
    • 5.0mA per LED (5.0V)
    • Due to the low current, this board can be run using the TinyDuino coin cell option
Pins Used
  • Pins 5, 6, 7, 8, and 9 are used, see schematic or sample code for connections
Dimensions
  • 20mm x 20mm (.787 inches x .787 inches)
  • Max Height (from lower bottom TinyShield Connector to upper top TinyShield Connector): 5.11mm (0.201 inches)
  • Weight: 1 gram (.04 ounces)

Notes

  • If the top connector is not needed, there is also the Circle LED TinyShield which has LEDs that circle the entire board.

Materials

From Left to Right: TinyDuino, USB TinyShield, 16 Edge LED TinyShield

Hardware

Software


Hardware Assembly

On top of your processor board of choice, place the Matrix LED TinyShield. Plug a MicroUSB cable into the USB port (or USB shield) and then plug the cable into an available USB port on your computer. Make sure the processor is switched on.

An assembled stack of a TinyDuino, USB TinyShield, and Matrix LED TinyShield.


Software Setup

First, open the Arduino IDE. If you don't have it installed or are unfamiliar with how to upload the code, check out the TinyDuino Setup Tutorial or TinyZero Setup Tutorial depending on which processor you're using. No special libraries are required for this tutorial.

Upload Program

Code
/*
  TinyDuino 16 Edge LED TinyShield Example Sketch

  This example turns on one LED at a time,
  from 1 to 16 and then from 16 to 1.
  This example code is in the public domain.

  Written 09 April 2014
  By Ben Rose
  Modified 20 May 2019
  By Hunter Hykes

  https://TinyCircuits.com
*/

void setup()
{
  LedOn(0); //Pass a zero to turn all LEDs off
}

void loop()
{
  for(int i = 1; i < 16 ;i++) {
    LedOn(i);
    delay(20);
  };
  for(int i = 16; i > 1; i--) {
    LedOn(i);
    delay(20);
  };
}

void LedOn(int ledNum)
{
  for(int i = 5; i < 10; i++) {
    pinMode(i, INPUT);
    digitalWrite(i, LOW);
  };

  if(ledNum < 1 || ledNum > 16) return;

  char highpin[16] = {5,6,5,7,6,7,6,8,5,8,8,7,9,7,9,8};
  char lowpin[16] = {6,5,7,5,7,6,8,6,8,5,7,8,7,9,8,9};
  ledNum--;

  digitalWrite(highpin[ledNum], HIGH);
  digitalWrite(lowpin[ledNum], LOW);
  pinMode(highpin[ledNum], OUTPUT);
  pinMode(lowpin[ledNum], OUTPUT);
}

Once the upload is complete, you should be able to see the illuminated LED "traveling" from one side of the board to the other, back and forth.


Contact Us

If you have any questions or feedback, feel free to email us at info@tinycircuits.com or make a post on the forum.

Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it!

Thanks for making with us!


Downloads