Rene Cruz
/
LCD_Clock
Sosa
main.cpp@0:af7b404a4e12, 2014-09-17 (annotated)
- Committer:
- ReneCA
- Date:
- Wed Sep 17 15:47:44 2014 +0000
- Revision:
- 0:af7b404a4e12
Sosa;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ReneCA | 0:af7b404a4e12 | 1 | #include "mbed.h" |
ReneCA | 0:af7b404a4e12 | 2 | #include "TextLCD.h" |
ReneCA | 0:af7b404a4e12 | 3 | |
ReneCA | 0:af7b404a4e12 | 4 | TextLCD lcd(p20,p19,p21,p22,p23,p24); //rs,e,d4,d5,d6,d7 |
ReneCA | 0:af7b404a4e12 | 5 | int s,m,h; |
ReneCA | 0:af7b404a4e12 | 6 | |
ReneCA | 0:af7b404a4e12 | 7 | int main() { |
ReneCA | 0:af7b404a4e12 | 8 | while(1){ |
ReneCA | 0:af7b404a4e12 | 9 | for(h=0;h<24;h++){ |
ReneCA | 0:af7b404a4e12 | 10 | for(m=0;m<60;m++){ |
ReneCA | 0:af7b404a4e12 | 11 | for(s=0;s<60;s++){ |
ReneCA | 0:af7b404a4e12 | 12 | wait(1); |
ReneCA | 0:af7b404a4e12 | 13 | lcd.locate(0,1); |
ReneCA | 0:af7b404a4e12 | 14 | lcd.printf("Reloj: %2d:%2d:%2d",h,m,s); |
ReneCA | 0:af7b404a4e12 | 15 | } |
ReneCA | 0:af7b404a4e12 | 16 | } |
ReneCA | 0:af7b404a4e12 | 17 | } |
ReneCA | 0:af7b404a4e12 | 18 | } |
ReneCA | 0:af7b404a4e12 | 19 | } |