OLED

Dependencies:   mbed mbed-rtos Adafruit_GFX ssd1306_library

Files at this revision

API Documentation at this revision

Comitter:
Aleman77
Date:
Wed Nov 04 06:20:04 2020 +0000
Parent:
11:0309bef74ba8
Commit message:
RTOS OLED

Changed in this revision

Adafruit_GFX.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
ssd1306_library.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Adafruit_GFX.lib	Wed Nov 04 06:20:04 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/st17099ng/code/Adafruit_GFX/#2fe73307cb3c
--- a/main.cpp	Wed Feb 15 14:04:02 2017 -0600
+++ b/main.cpp	Wed Nov 04 06:20:04 2020 +0000
@@ -1,22 +1,40 @@
 #include "mbed.h"
+#include "Adafruit_SSD1306.h"
+#include "Adafruit_GFX.h" 
+#include "Adafruit_GFX_Config.h"
 #include "rtos.h"
- 
-DigitalOut led1(LED1);
-DigitalOut led2(LED2);
+
 Thread thread;
+DigitalOut pin(PC_13);
+I2C myI2C(PB_9,PB_8);
+Adafruit_SSD1306_I2c oled(myI2C,PB_7,0x78,64,128);
+Ticker ticker;
+void OLED(){
+    //oled.clearDisplay();
+    }
+struct PROYECT : Adafruit_GFX {
+    
+    PROYECT(int16_t x, int16_t y): Adafruit_GFX (x,y){}
+
+    };
  
-void led2_thread() {
-    while (true) {
-        led2 = !led2;
-        Thread::wait(1000);
+int main() {
+    ticker.attach(&OLED,0.320);
+     
+    int t=1604340235;
+    //
+     set_time(t);
+    while (true) {  
+    oled.clearDisplay();
+    //   oled.printf("%s\r", ctime(&seconds));  
+       time_t seconds = time(NULL);
+       oled.setTextCursor(10,0);
+       oled.printf("%s", ctime(&seconds));
+       
+       oled.setTextCursor(38,17);
+       oled.printf("%s"" SPI/ I2C");
+       
+       oled.display();
+       wait_ms(16);    
     }
 }
- 
-int main() {
-    thread.start(led2_thread);
-    
-    while (true) {
-        led1 = !led1;
-        Thread::wait(500);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ssd1306_library.lib	Wed Nov 04 06:20:04 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/rodriguj/code/ssd1306_library/#57209a7e9cba