SevenSegment Library for Arduino Author: Alexander Brevig Contact: alexanderbrevig@gmail.com
1.2 2009-04-13: Ready for ShiftRegisters
1.2 2009-04-13: Ready for ShiftRegisters
1.1 2009-03-16: Uses binary logic to represent states, not ints. [uses 14 x less ram].
1.0 2009-03-13: Initial Release
SevenSegment is a library for the Arduino.
It is created to help Hardware Abstraction, and readability of code. It hides the pinMode, and digitalRead calls for the user.
SevenSegment library is part of the Hardware Abstraction libraries.
Download here: Attach:SevenSegment.zip
Put the SevenSegment folder in "hardware\libraries\".
In the Arduino IDE, create a new sketch (or open one) and select from the menubar "Sketch->Import Library>SevenSegment".
Once the library is imported, an '#include<SevenSegment.h>' line will appear at the top of your Sketch.
SevenSegment() //default 2,3,4,5,6,7,8 SevenSegment(byte userPins[])
byte pins[] = {6,7,8,9,10,11,12}; SevenSegment sevenSegment = SevenSegment(pins);
Instanciates a SevenSegment object connected to digital pins 6,7,8,9,10,11 and 12.
Prepare a byte to be shifted
Shift out the buffered byte
Shift out the number
Connect a ShiftRegister to the SevenSegment.
How can I use multiple SevenSegment displays?
SevenSegment is a class. Therefore to SevenSegment multiple digital pins, you must create an instance for each of them.
Say you have sevenSegment and sevenSegment2 it's just to call whatever function is wanted on target SevenSegment object
//check sevenSegment sevenSegment.buffer(2); sevenSegment2.print(3);
Part of AlphaBeta Libraries. | |
Last Modified: | May 09, 2009, at 05:12 AM |
By: | AlphaBeta |