![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Programski kod sata/brojača. Izveden pomoću 4 tipkala i LCD zaslonom rezolucije 16x2 točaka.
Dependencies: mbed Bljeskalica TextLCD
Prikaz trenutnog vremena i datuma na LCD zaslonu rezolucije 16x2 točaka. U gornjem redu prikazuje se datum u formatu: dan/mjesec/godina, a u donjem redu vrijeme u formatu: sat/minuta/sekunda. Podešenje vremena i datuma je pomoću tipkala i to u inkrementima po 1 (sekunda, minuta, sat, dan, mjesec, godina).
main.cpp@0:1c9b141ec08b, 2020-06-11 (annotated)
- Committer:
- dariojankovic
- Date:
- Thu Jun 11 22:28:08 2020 +0000
- Revision:
- 0:1c9b141ec08b
Proba
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dariojankovic | 0:1c9b141ec08b | 1 | #include "main.h" |
dariojankovic | 0:1c9b141ec08b | 2 | |
dariojankovic | 0:1c9b141ec08b | 3 | int main() { |
dariojankovic | 0:1c9b141ec08b | 4 | |
dariojankovic | 0:1c9b141ec08b | 5 | DAN_SAT.mode(PullUp); |
dariojankovic | 0:1c9b141ec08b | 6 | MJESEC_MINUTA.mode(PullUp); |
dariojankovic | 0:1c9b141ec08b | 7 | GODINA_SEKUNDA.mode(PullUp); |
dariojankovic | 0:1c9b141ec08b | 8 | DATUM.mode(PullUp); |
dariojankovic | 0:1c9b141ec08b | 9 | VRIJEME.mode(PullUp); |
dariojankovic | 0:1c9b141ec08b | 10 | |
dariojankovic | 0:1c9b141ec08b | 11 | debounce.start(); |
dariojankovic | 0:1c9b141ec08b | 12 | DAN_SAT.fall(&toggle_DAN_SAT); |
dariojankovic | 0:1c9b141ec08b | 13 | MJESEC_MINUTA.fall(&toggle_MJESEC_MINUTA); |
dariojankovic | 0:1c9b141ec08b | 14 | GODINA_SEKUNDA.fall(&toggle_GODINA_SEKUNDA); |
dariojankovic | 0:1c9b141ec08b | 15 | DATUM.fall(&toggle_DATUM); |
dariojankovic | 0:1c9b141ec08b | 16 | |
dariojankovic | 0:1c9b141ec08b | 17 | led.flash(5); |
dariojankovic | 0:1c9b141ec08b | 18 | |
dariojankovic | 0:1c9b141ec08b | 19 | LCD.cls(); |
dariojankovic | 0:1c9b141ec08b | 20 | |
dariojankovic | 0:1c9b141ec08b | 21 | while(1) { |
dariojankovic | 0:1c9b141ec08b | 22 | ZASLON(); |
dariojankovic | 0:1c9b141ec08b | 23 | wait(1); } |
dariojankovic | 0:1c9b141ec08b | 24 | } |