An archive of community.esquilo.io as of Saturday January 26, 2019.

Esquilo Air & 5161AS 1 digit 7 segment LED Tutorial

softwarejanitor

Esquilo Air & 5161AS 1 digit 7 segment LED Tutorial

Made by Leeland Heins

About this project

This is a simple example setup to show how to hook a 5161AS 1 digit 7 segment
LED display to an Esquilo Air.

Project info
Difficulty: Easy
Estimated Time: 1 hour

Story

This project builds on the typical LED examples because the basics of the
5161AS 1 digit 7 segment LED is basically similar to 8 LEDS except for the
difference that they share a common anode or cathode (depending on the type
you have). These types of displays are made by several different makers
and there are some minor differences in specs and pinout. You may need to
find the exact datasheet for the version you have and adjust the wiring
diagram to suit.

Here is the pinout for the 5161AS I used for this tutorial:

             AAA
 E    1 --  F   B    -- 10   G
 D    2 --  F   B    -- 9    F
GND   3 --   GGG     -- 8   GND
 C    4 --  E   C    -- 7    A
 dp   5 --  E   C    -- 6    B
             DDD  dp

A typical 5161AS datasheet can be found here:

http://www.topliteusa.com/uploadfile/2014/0825/A-5161AS.pdf

Step 1:Parts List

1 Esquilo Air
1 5161AS 1 digit 7 segment LED
1 220 Ohm resistor
1 Breadboard
10 Male-Male hookup wires. It is nice to make them color coordinated.

I used:

2 black
1 red
2 white
2 blue
1 orange
1 green
1 yellow

Step 2: Connect the components

Connect the components and wires as shown in the pictures.


Step 3: Load the code into the IDE

//
// LED 5161AS demo
//
// 20161214 Leeland Heins
//
require("GPIO");

// Load the library.
dofile("sd:/LED_5161AS.nut");

// Instantiate our class.
local led = LED_5161AS();

// Turn on all LED segments
led.all_on();

delay(500);

// Turn off all LED segments
led.all_off();

delay(500);

local i;

// Display hex digits 0-f and blink decimal point between
for (i = 0; i < 16; i++) {
    led.digit(i);

    delay(500);

    led.blink_dp();

    delay(500);

    led.blink_dp();
    
    delay(500);
    
    led.blink_dp();
    
    delay(500);
    
    led.blink_dp();
}

delay(500);

led.all_off();

The library can be found here:

https://github.com/softwarejanitor/LED_5161AS

Step 4: Run the nut

softwarejanitor

This is now also on Hackster...

https://www.hackster.io/softwarejanitor/esquilo-air-5161as-1-digit-7-segment-led-tutorial-4e7ec6