Skip to content

Circle Edge LED TinyShield Tutorial

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

Learn more about the TinyDuino Platform


Description

The Circle Edge LED TinyShield has 21 LEDs mounted around the edge of the board to form a full circle. These LEDs only use six signals from the TinyDuino using a technique called Charlieplexing, which saves the other I/O pins for other functions of your project. This TinyShield is designed to be placed on the top of a TinyShield stack since it does not have a top 32-pin connector.

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

Technical Details LED Specs
  • 21 Side Mounted LEDs around the side of the board
  • Charlieplexed IO on 6 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 4, 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 LEDS): 3.31mm (0.130 inches)
  • Weight: .73 grams (.026 ounces)

Notes

  • This board has no top TinyShield connector, so no additional TinyShields can be stacked on top of this.  This board is meant to be on the top of a TinyDuino stack.
  • If a top connector is needed to stack additional TinyShields, you may be interested in the 16 Edge LED TinyShield which has 16 LEDs and a top connector.

Materials

From Left to Right: TinyDuino, USB TinyShield, Circle 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 Circle Edge 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 Circle Edge LED TunyShield Example Sketch

  This example turns on one LED at a time,
  from 1 to 21, creating a circular path.
  This example code is in the public domain.

  Written 09 April 2014
  By Ben Rose
  Modified 07 January 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 <= 21; i++) {
    LedOn(i);
    delay(20);
  };
}

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

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

  char highpin[21] = {5,6,5,7,6,7,6,8,5,8,8,7,9,7,9,8,5,9,6,9,9};
  char lowpin[21] = {6,5,7,5,7,6,8,6,8,5,7,8,7,9,8,9,9,5,9,6,4};
  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 "travelling" around the circle edge.


Downloads


Contact Us

If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

Thanks for making with us!