SPI,I2C,RTC

Dependencies:   MFRC522_Updated ssd1306_library

Committer:
20172573073
Date:
Wed May 20 03:23:49 2020 +0000
Revision:
8:51c5c171bbf6
Parent:
7:6372f34c11d1
Child:
9:935f87e2299d
formato tiempo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andres0705 7:6372f34c11d1 1 #include "mbed.h"
andres0705 7:6372f34c11d1 2 #include "stdio.h"
20172573073 1:fd4f40b923e7 3 #include "string.h"
andres0705 2:8083cd0c48a8 4 #include "ssd1306.h"
20172573073 3:bd37bcc0ec09 5 SSD1306 lcd (D7, D6);
20172573073 1:fd4f40b923e7 6 Serial pc(USBTX, USBRX);
20172573073 3:bd37bcc0ec09 7 Ticker t;
20172573073 3:bd37bcc0ec09 8 int q=0;
20172573073 3:bd37bcc0ec09 9 void conteo()
20172573073 3:bd37bcc0ec09 10 {
20172573073 3:bd37bcc0ec09 11 q=q+1;
20172573073 3:bd37bcc0ec09 12 }
20172573073 3:bd37bcc0ec09 13 int main()
20172573073 3:bd37bcc0ec09 14 {
20172573073 3:bd37bcc0ec09 15 t.attach(&conteo,1);
20172573073 3:bd37bcc0ec09 16 q=1589916065;
andres0705 6:820dac5cdd1e 17 lcd.init();
andres0705 2:8083cd0c48a8 18 lcd.speed (SSD1306::Medium);
20172573073 3:bd37bcc0ec09 19 lcd.cls();
20172573073 3:bd37bcc0ec09 20 lcd.locate (3,1);
20172573073 5:e86f65d4cdf2 21 lcd.printf ("Escaner RF");
20172573073 5:e86f65d4cdf2 22 lcd.locate (4,1);
20172573073 5:e86f65d4cdf2 23 lcd.printf ("Andres Arevalo");
20172573073 5:e86f65d4cdf2 24 lcd.locate (5,1);
20172573073 5:e86f65d4cdf2 25 lcd.printf ("Andres castano");
20172573073 4:500f1ba2d17a 26 lcd.redraw();
20172573073 5:e86f65d4cdf2 27 wait(3);
20172573073 5:e86f65d4cdf2 28 lcd.redraw();
andres0705 6:820dac5cdd1e 29
andres0705 6:820dac5cdd1e 30 while (true) {
andres0705 6:820dac5cdd1e 31
andres0705 6:820dac5cdd1e 32 lcd.redraw();
20172573073 3:bd37bcc0ec09 33 set_time(q);
20172573073 0:fbda9e7e9269 34 time_t seconds = time(NULL);
20172573073 3:bd37bcc0ec09 35
20172573073 8:51c5c171bbf6 36 char buffer2[32];
20172573073 8:51c5c171bbf6 37 strftime(buffer2, 32, "%m/%d/%y", localtime(&seconds));
20172573073 8:51c5c171bbf6 38 pc.printf("%s", buffer2);
20172573073 8:51c5c171bbf6 39 char buffer1[32];
20172573073 8:51c5c171bbf6 40 strftime(buffer1, 32, "%H:%M:%S", localtime(&seconds));
20172573073 8:51c5c171bbf6 41 pc.printf(" , %s\n\r", buffer1);
20172573073 8:51c5c171bbf6 42
20172573073 3:bd37bcc0ec09 43
20172573073 0:fbda9e7e9269 44 wait(1);
20172573073 0:fbda9e7e9269 45 }
20172573073 8:51c5c171bbf6 46 }