You are on page 1of 3

1.

please connect arduino board with the tube according to following datasheet

(numeral tube name) (numeral tubenumber) (tube pin number of arduino)


DIG1 12 2
DIG2 9 3
DIG3 8 4
DIG4 6 5
A 11 6
B 7 7
C 4 8
D 2 9
E 1 10
F 10 11
G 5 12
DP 3 13
2. put the library files under library folder, load the test codes to arduino board, then you
will see the stopwatchprogram of digital tube starts to work)

test program

#include "SevSeg.h"
//Create an instance of the object.
SevSegsevseg;
//Create global variables
unsigned long timer;
intCentSec=0;

void setup() {
//I am using a common anode display, with the digit pins connected
//from 2-5 and the segment pins connected from 6-13
sevseg.Begin(0,2,3,4,5,6,7,8,9,10,11,12,13);
timer=millis();
}

void loop() {
//Produce an output on the display
sevseg.PrintOutput();

//Check if 10ms has elapsed


unsigned long mils=millis();
if (mils-timer>=10) {
timer=mils;
CentSec++;
if (CentSec==10000) { // Reset to 0 after counting for 100 seconds.
CentSec=0;
}
//Update the number to be displayed, with a decimal
//place in the correct position.
sevseg.NewNum(CentSec,(byte) 2);
}
}

You might also like