Go Down

Topic: [Project] Seven segments display library (Read 985 times) previous topic - next topic

NeXTWay

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: [Select]
#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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy