diamond2016
Published © GPL3+

LTS-546AWC - Single Digit LED

This is a simple library for the common anode LTS 546AWC single digit display. Allows to turn on off segments and display digits.

BeginnerProtip5,573
LTS-546AWC - Single Digit LED

Things used in this project

Story

Read more

Schematics

LTS-546AWC Arduino connection

Connection of arduino pins to led display. Connections from Arduino:
ledPinDP = 9; // the number of the LED pin decimal point
ledPinG = 8; // the number of the LED pin segment G
ledPinF = 7; // the number of the LED pin segment F
ledPinE = 6; // the numero of the LED pin segment E
ledPinD = 5; // the segment of the LED pin segment D
ledPinC = 4; // the number of the LED pin segment C
ledPinB = 3; // the number of the LED pin segment B
ledPinA = 2; // the number of the LED pin segment A

Code

Example sketch using the library

Arduino
This example, using the library liblts546awc provided for this project, displays every segment of LTS-546AWC, and then numbers in ordinal and reverse order
/*
  Liblts546awc.ino
  Example arduino skectch for library liblts546awc
  
  The library controls one digit element LED
  Type common anode
  Model LTS-546AWC but pins are easily adaptable to layout
  Turns on and off a light emitting diode(LED) connected to digital pin
  Layout is with 3 or 8 common anode
  The circuit:
  - Common anode 3 (+5V)
  - Resistor 220Ohm for every led input
  - Arduino pins from 2 (A) to 8 (G) and 9 = DP (decimal point)
  - Displays segments snd numbers in direct and reverse order
  created april 2019
  by Riccardo G Corsi
  last modified 27 apr 2019
  This example code is in the public domain.
*/

include "liblts546awc.h"
LTS546AWC ledModule = LTS546AWC();


void setup() {
   ledModule.begin();
  // initialize LED pin HIGH to turn off
   ledModule.clearAll();
}

void loop() {
    ledModule.diag();     
    ledModule.clearAll();
    count();
    ledModule.clearAll();
    reverse();   
    delay(2*digitDelay);           
}


void count() {
  for (int i = 0; i < 10; i++) {
    ledModule.setDigit(i);
    delay(digitDelay);
  }             
}

void reverse() {
  for (int i = 9; i >= 0; i--) {
    ledModule.setDigit(i);
    delay(digitDelay);
  }             
}

GitHub repository

Library LTS546AWC

Credits

diamond2016
2 projects • 8 followers
Contact

Comments

Please log in or sign up to comment.