-
Notifications
You must be signed in to change notification settings - Fork 0
/
P14-LCD_DATE_CLOCK.c
33 lines (30 loc) · 952 Bytes
/
P14-LCD_DATE_CLOCK.c
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
#include <stdio.h>
#include <mega16.h>
#include <delay.h>
#include <alcd.h>
int y, x, d, h, m, s;
char lcd[16];
void main() {
lcd_init(16);
while (1) {
for (y = 0; y < 10000; y++) {
for (x = 0; x < 13; x++) {
for (d = 0; d < 32; d++) {
for (h = 0; h < 24; h++) {
for (m = 0; m < 60; m++) {
for (s = 0; s < 60; s++) {
lcd_gotoxy(4, 0);
sprintf(lcd, "%02d:%02d:%02d", h, m, s);
lcd_puts(lcd);
lcd_gotoxy(3, 1);
sprintf(lcd, "%04d:%02d:%02d", y, x, d);
lcd_puts(lcd);
delay_ms(1000);
}
}
}
}
}
}
}
}