Devices & Components
Arduino Uno Rev3
Resistor 221 ohm
LTS-546AWC
Project description
Code
GitHub repository
Library LTS546AWC
GitHub repository
Library LTS546AWC
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
1 2/* 3 Liblts546awc.ino 4 Example arduino skectch for library liblts546awc 5 6 The library controls one digit element LED 7 Type common anode 8 Model LTS-546AWC but pins are easily adaptable to layout 9 Turns on and off a light emitting diode(LED) connected to digital pin 10 Layout is with 3 or 8 common anode 11 The circuit: 12 - Common anode 3 (+5V) 13 - Resistor 220Ohm for every led input 14 - Arduino pins from 2 (A) to 8 (G) and 9 = DP (decimal point) 15 - Displays segments snd numbers in direct and reverse order 16 created april 2019 17 by Riccardo G Corsi 18 last modified 27 apr 2019 19 This example code is in the public domain. 20*/ 21 22include "liblts546awc.h" 23LTS546AWC ledModule = LTS546AWC(); 24 25 26void setup() { 27 ledModule.begin(); 28 // initialize LED pin HIGH to turn off 29 ledModule.clearAll(); 30} 31 32void loop() { 33 ledModule.diag(); 34 ledModule.clearAll(); 35 count(); 36 ledModule.clearAll(); 37 reverse(); 38 delay(2*digitDelay); 39} 40 41 42void count() { 43 for (int i = 0; i < 10; i++) { 44 ledModule.setDigit(i); 45 delay(digitDelay); 46 } 47} 48 49void reverse() { 50 for (int i = 9; i >= 0; i--) { 51 ledModule.setDigit(i); 52 delay(digitDelay); 53 } 54}
Downloadable files
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
LTS-546AWC Arduino connection

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
LTS-546AWC Arduino connection

Comments
Only logged in users can leave comments