forked from labos-medialab/7segment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kod.ino
54 lines (41 loc) · 812 Bytes
/
kod.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
byte numbers[10] = {B1111110,B0110000,B1011011,B1111001,B0110011,B1011011,B1011111,B1110000,B1111111,B1110011};
byte pins[8] = {2, //a
3, //b
4, //c
5, //d
6, //e
7, //f
8, //g
9};//h
void setup()
{
Serial.begin(9600);
for ( byte i = 0; i<sizeof(pins); i++)
{
pinMode(pins[i], OUTPUT);
}
}
void loop()
{
// put your main code here, to run repeatedly:
}
void serialEvent()
{
delay(10);
}
void printNumb(byte number)
{
if (number>9) number =9;
for(byte i = 0; i<7; i++)
{
digitalWrite(pins[i],bitRead(!numbers[number], i));
}
}
void printNumbs(int number)
{
if(number>9999) number = 9999;
int devider = 1000;
for ( byte i = 0; i<4; i++)
{
}
}