Skip to content

7 Segment Display TinyShield Tutorial

The 7 Segment Display TinyShield is great for data visualization of all sorts whether it be temperature, humidity, time, speed, positioning, or any other type of numerical data.

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

Learn more about the TinyDuino Platform


Description

The 7 Segment Display TinyShield contains two 7-segment displays which operate over I2C via a Semtech SX1506 I/O expander. Only two signals from the TinyDuino processor are required to drive the I2C communication.

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

Technical Details Display Specs
  • Two Seven Segment LEDs, Color Red
  • Displays include decimal indicator
  • I2C Semtech SX1506 I/O Expander
TinyDuino Power Requirements
  • Voltage: 3.0V - 5.5V
  • Current:
    • 4mA per segment (3.0V)
    • 10mA per segment (5.0V)
    • Due to the current, this board can run for a very short time on the TinyDuino with coin cell, however a Lithium battery should be used for longer life.
Pins Used
  • A5/SCL - I2C Serial Clock line
  • A4/SDA - I2C Serial Data line
Dimensions
  • 20mm x 20mm (.787 inches x .787 inches)
  • Max Height (from lower bottom TinyShield Connector to upper top of LED displays): 6.6mm (.26 inches)
  • Weight: 1.36 grams (.05 ounces)

Materials

TinyZero and 7 Segment Display TinyShield

Hardware

Software


Hardware Assembly

On top of your processor board of choice, place the 7 Segment Display 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 TinyZero and 7 Segment Display 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.

This sample code requires the Tiny7Seg library which is included with the 7 Segment Display TinyShield Example Sketch.

Upload Program

Code
/*
  TinyCircuits 7 Segment Display TinyShield Example Sketch

  This sketch demonstrates the functionality of the display by
  counting down from 5, flashing "00" three times, then toggles
  the decimal segments indefinitely.

  Written 
  By 
  Modified 07 January 2019
  By Hunter Hykes

  https://TinyCircuits.com
*/

#include <Wire.h>
#include "Tiny7Seg.h"

Tiny7Seg seg;

void setup()
{
  Wire.begin();
  seg.init();
  for(int i=5; i>0; i--){
    seg.printInt(i);
    delay(500);
  };
  for(int i=0; i<5; i++){
    seg.printInt(0);
    delay(100);
    seg.off();
    delay(100);
  };
}

void loop()
{
  seg.setDecPoints(1,0);
  delay(50);
  seg.setDecPoints(0,1);
  delay(50);
}

Once the upload is complete, you should be able to see the 7 segment displays count down from 05 to 00, flash 00 three times, then toggle the decimal points indefinitely.


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!