Pages: [1]   Go Down
Author Topic: [Project] Seven segments display library  (Read 801 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 108
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everybody,
this morning I really wanted to control a seven segments display, so I bought one and looked for a library, but I couldn't find any.
So I coded my first one (:

Since this kind of display is quite confusing when showing letters, I decided only to display numbers (when I'm getting a more-digit display, I will add the possibility of writing letters too).

I've attached the library: it's super-simple.
If you think you can improve it, you are free to edit it as you please.

To test it, i've connected my 7Segs to pins 2-8 and run this simple program:
Code:
#include <SevenSegments.h>

SevenSegments display(2,3,4,5,6,7,8);

void setup(){
  Serial.begin(9600);
}

void loop() {
  if (Serial.available() ){
   display.write(Serial.read() - 48);
  }
}

And... it works! =D

* SevenSegments.zip (1.43 KB - downloaded 7 times.)
Logged

Pages: [1]   Go Up
Jump to: