Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Patrick Fitzgerald
Published © GPL3+

C-plus-plus Code for 7 Segment LED

You'd think a technology this old would be simple. C-plus-plus software libraries help you with hardware wiring.

IntermediateProtip2 hours670

Things used in this project

Hardware components

7 Segment LED Display, InfoVue
7 Segment LED Display, InfoVue
×1
Resistor 100 ohm
Resistor 100 ohm
×8
Arduino UNO
Arduino UNO
×1
DIP / SIP Switch, 8 Circuits
DIP / SIP Switch, 8 Circuits
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

adv7seg.ino

Arduino
Arduino demo sketch to run on 7segment LED display
uses AdvancedSevenSegment library
arbitrary pinouts
#include <Arduino.h>
#include <AdvancedSevenSegment.h>
// included library function uses IO A0 = 14, A1 = 15
AdvanceSevenSegment display(8, 9, 10, 11, 12, 13, 14, 15);
void setup() {  }
void loop() {
    for (int i = 0; i <= 9; ++i) {
         display.setNumber(i);
        delay(1000);
    }
     display.refresh();

    char list[] = {'a','b','c','d','e','f','h','l','p','q','u','y'};
    for (char c : list) {
         display.setCharacter(c);
        delay(1000);
    }
     display.refresh();
}

Credits

Patrick Fitzgerald
124 projects • 45 followers
Contact

Comments

Please log in or sign up to comment.