forked from sadken/TZXDuino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Counters.ino
48 lines (43 loc) · 1.13 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
// Counter1 updates the file percentage completion and also the time elapsed
// Counter2 only displays the file percentage (should be called when the file percentage changes i.e. during processing handler)
// displayLcdTime (in Display.ino) shows the time elapsed
void Counter1() {
// display newpct
Counter2();
// display time
displayLcdTime();
}
void Counter2()
{
#if defined(LCDSCREEN16x2) || defined(RGBLCD)
// TODO which is better, this
lcd.setCursor(8,0);
lcd.print(newpct);
lcd.print("%");
// or this (from old Counter1 code)
/*
itoa(newpct,PlayBytes,10);
strcat_P(PlayBytes,PSTR("%"));
lcd.setCursor(8,0);
lcd.print(PlayBytes);
*/
#endif
#ifdef OLED1306
itoa(newpct,PlayBytes,10);
sendStrXY(PlayBytes,8,0);
sendChar('%');
#endif
#ifdef P8544
// TODO which is better, this
lcd.setCursor(0,3);
lcd.print(newpct);
lcd.print("%");
// or this (from old Counter1 code)
/*
itoa(newpct,PlayBytes,10);
strcat_P(PlayBytes,PSTR("%"));
lcd.setCursor(0,3);
lcd.print(PlayBytes);
*/
#endif
}