SPI,I2C,RTC
Dependencies: MFRC522_Updated ssd1306_library
main.cpp@6:820dac5cdd1e, 2020-05-20 (annotated)
- Committer:
- andres0705
- Date:
- Wed May 20 01:36:08 2020 +0000
- Revision:
- 6:820dac5cdd1e
- Parent:
- 5:e86f65d4cdf2
- Child:
- 7:6372f34c11d1
Rc;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
20172573073 | 1:fd4f40b923e7 | 1 | #include "string.h" |
andres0705 | 2:8083cd0c48a8 | 2 | #include "ssd1306.h" |
20172573073 | 3:bd37bcc0ec09 | 3 | SSD1306 lcd (D7, D6); |
20172573073 | 1:fd4f40b923e7 | 4 | Serial pc(USBTX, USBRX); |
20172573073 | 3:bd37bcc0ec09 | 5 | Ticker t; |
20172573073 | 3:bd37bcc0ec09 | 6 | int q=0; |
20172573073 | 3:bd37bcc0ec09 | 7 | void conteo() |
20172573073 | 3:bd37bcc0ec09 | 8 | { |
20172573073 | 3:bd37bcc0ec09 | 9 | q=q+1; |
20172573073 | 3:bd37bcc0ec09 | 10 | } |
20172573073 | 3:bd37bcc0ec09 | 11 | int main() |
20172573073 | 3:bd37bcc0ec09 | 12 | { |
20172573073 | 3:bd37bcc0ec09 | 13 | t.attach(&conteo,1); |
20172573073 | 3:bd37bcc0ec09 | 14 | q=1589916065; |
andres0705 | 6:820dac5cdd1e | 15 | lcd.init(); |
andres0705 | 2:8083cd0c48a8 | 16 | lcd.speed (SSD1306::Medium); |
20172573073 | 3:bd37bcc0ec09 | 17 | lcd.cls(); |
20172573073 | 3:bd37bcc0ec09 | 18 | lcd.locate (3,1); |
20172573073 | 5:e86f65d4cdf2 | 19 | lcd.printf ("Escaner RF"); |
20172573073 | 5:e86f65d4cdf2 | 20 | lcd.locate (4,1); |
20172573073 | 5:e86f65d4cdf2 | 21 | lcd.printf ("Andres Arevalo"); |
20172573073 | 5:e86f65d4cdf2 | 22 | lcd.locate (5,1); |
20172573073 | 5:e86f65d4cdf2 | 23 | lcd.printf ("Andres castano"); |
20172573073 | 4:500f1ba2d17a | 24 | lcd.redraw(); |
20172573073 | 5:e86f65d4cdf2 | 25 | wait(3); |
20172573073 | 5:e86f65d4cdf2 | 26 | lcd.redraw(); |
andres0705 | 6:820dac5cdd1e | 27 | |
andres0705 | 6:820dac5cdd1e | 28 | while (true) { |
andres0705 | 6:820dac5cdd1e | 29 | |
andres0705 | 6:820dac5cdd1e | 30 | lcd.redraw(); |
20172573073 | 3:bd37bcc0ec09 | 31 | set_time(q); |
20172573073 | 0:fbda9e7e9269 | 32 | time_t seconds = time(NULL); |
20172573073 | 3:bd37bcc0ec09 | 33 | |
20172573073 | 1:fd4f40b923e7 | 34 | pc.printf("fecha %s\n\r", ctime(&seconds)); |
20172573073 | 0:fbda9e7e9269 | 35 | |
20172573073 | 3:bd37bcc0ec09 | 36 | |
20172573073 | 0:fbda9e7e9269 | 37 | wait(1); |
20172573073 | 0:fbda9e7e9269 | 38 | } |
andres0705 | 6:820dac5cdd1e | 39 | } |