-
Notifications
You must be signed in to change notification settings - Fork 33
/
Counters.ino
106 lines (79 loc) · 3.62 KB
/
Counters.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
void Counter1() {
#ifdef LCDSCREEN16x2
itoa(newpct,PlayBytes,10);
strcat_P(PlayBytes,PSTR("%"));
lcd.setCursor(8,0);
lcd.print(PlayBytes);
//sprintf(PlayBytes,"%03d",lcdsegs%1000);lcd.setCursor(13,0);lcd.print(PlayBytes);
strcpy(PlayBytes,"000");
if ((lcdsegs %1000) <10) itoa(lcdsegs%10,PlayBytes+2,10);
else
if ((lcdsegs %1000) <100)itoa(lcdsegs%1000,PlayBytes+1,10);
else
itoa(lcdsegs%1000,PlayBytes,10);
lcd.setCursor(13,0);
lcd.print(PlayBytes);
#endif
#ifdef RGBLCD
itoa(newpct,PlayBytes,10);
strcat_P(PlayBytes,PSTR("%"));
lcd.setCursor(8,0);
lcd.print(PlayBytes);
/*
//sprintf(PlayBytes,"%03d",lcdsegs%1000);lcd.setCursor(13,0);lcd.print(PlayBytes);
strcpy(PlayBytes,"000");
if ((lcdsegs %1000) <10) itoa(lcdsegs%10,PlayBytes+2,10);
else
if ((lcdsegs %1000) <100)itoa(lcdsegs%1000,PlayBytes+1,10);
else
itoa(lcdsegs%1000,PlayBytes,10);
lcd.setCursor(13,0);
lcd.print(PlayBytes); */
#endif
#ifdef OLED1306
itoa(newpct,PlayBytes,10);strcat_P(PlayBytes,PSTR("%"));sendStrXY(PlayBytes,8,0);
strcpy(PlayBytes,"000");
if ((lcdsegs %1000) <10) itoa(lcdsegs%10,PlayBytes+2,10);
else
if ((lcdsegs %1000) <100)itoa(lcdsegs%1000,PlayBytes+1,10);
else
itoa(lcdsegs%1000,PlayBytes,10);
sendStrXY(PlayBytes,13,0);
#endif
#ifdef P8544
itoa(newpct,PlayBytes,10);
strcat_P(PlayBytes,PSTR("%"));
lcd.setCursor(0,3);
lcd.print(PlayBytes);
//sprintf(PlayBytes,"%03d",lcdsegs%1000);lcd.setCursor(13,0);lcd.print(PlayBytes);strcpy(PlayBytes,"000");
if ((lcdsegs %1000) <10) itoa(lcdsegs%10,PlayBytes+2,10);
else
if ((lcdsegs %1000) <100)itoa(lcdsegs%1000,PlayBytes+1,10);
else
itoa(lcdsegs%1000,PlayBytes,10);
#endif
}
void Counter2() {
#ifdef LCDSCREEN16x2
lcd.setCursor(8,0);
lcd.print(newpct);
lcd.print("%");
#endif
#ifdef RGBLCD
lcd.setCursor(8,0);
lcd.print(newpct);
lcd.print("%");
#endif
#ifdef OLED1306
if (newpct <10) {setXY(8,0);sendChar(48+newpct%10);}
else
if (newpct <100){setXY(8,0);sendChar(48+newpct/10); sendChar(48+newpct%10);}
else {setXY(8,0);sendChar('1');sendChar('0');sendChar('0');}
sendChar('%');
#endif
#ifdef P8544
lcd.setCursor(0,3);
lcd.print(newpct);
lcd.print("%");
#endif
}