SPI,I2C,RTC
Dependencies: MFRC522_Updated ssd1306_library
main.cpp
- Committer:
- andres0705
- Date:
- 2020-05-20
- Revision:
- 9:935f87e2299d
- Parent:
- 8:51c5c171bbf6
- Child:
- 10:7e62c3111814
File content as of revision 9:935f87e2299d:
#include "mbed.h" #include "stdio.h" #include "string.h" #include "ssd1306.h" #include "MFRC522.h" SSD1306 lcd (D7, D6); Serial pc(USBTX, USBRX); Ticker t; int q=0; void conteo() { q=q+1; } int main() { t.attach(&conteo,1); q=1589916065; lcd.init(); lcd.speed (SSD1306::Medium); lcd.cls(); lcd.locate (3,1); lcd.printf ("Escaner RF"); lcd.locate (4,1); lcd.printf ("Andres Arevalo"); lcd.locate (5,1); lcd.printf ("Andres castano"); lcd.redraw(); wait(3); lcd.redraw(); while (true) { lcd.redraw(); set_time(q); time_t seconds = time(NULL); char buffer2[32]; strftime(buffer2, 32, "%m/%d/%y", localtime(&seconds)); pc.printf("%s", buffer2); char buffer1[32]; strftime(buffer1, 32, "%H:%M:%S", localtime(&seconds)); pc.printf(" , %s\n\r", buffer1); wait(1); } }