Oled I2C SSD1306

Dependencies:   SSD1306_128x64_I2C mbed

Fork of DisplayOled1 by Frank Girald

Files at this revision

API Documentation at this revision

Comitter:
franni
Date:
Thu Nov 02 20:37:20 2017 +0000
Parent:
1:7195b6d24cf4
Commit message:
Oled12c

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 7195b6d24cf4 -r ebb4b427aecc main.cpp
--- a/main.cpp	Tue May 23 18:39:12 2017 +0000
+++ b/main.cpp	Thu Nov 02 20:37:20 2017 +0000
@@ -1,22 +1,44 @@
- #include "mbed.h"
- #include "SSD1306.h"
+#include "mbed.h"
+#include "SSD1306.h"
+#include "Adafruit_GFX.h"
+#define SPLASH_ADAFRUIT
+#define GFX_WANT_ABSTRACTS
+#define D_SDA                  PTC11
+#define D_SCL                  PTC10
 
- #define D_SDA                  PTE25
- #define D_SCL                  PTE24
- I2C i2c(D_SDA, D_SCL);
- 
+I2C i2c(D_SDA, D_SCL); 
+ int m=0;
  SSD1306 oled = SSD1306(i2c, SSD1308_SA0);
  
- int main() {
- oled.writeString(0, 0, "Universidad Distrital");
-   //  oled.printf("Hello World !");
-  wait(1); 
-  
- oled.writeString(0, 0, "2017 Digitales II");
+DigitalIn S1(PTD5);
+DigitalIn S2(PTA13);
+DigitalIn hab(PTD3);
+Timer Timer1;
+InterruptIn int1(PTD0);
+PwmOut servo (PTD2);
 
- 
-
+int main() {
+ oled.writeString(0, 0, "conectado");      
+    
+while(1){
+     switch (m){
+    case 0:
+         oled.writeString(2, 1, "pos 0 grados");
+     servo=1;
+        wait_us(500);
+        servo=0;
+        wait_us(19500);
+        wait(2);
+        if (hab==1){
+           m=1;
+            }
+        
+         break;
+      case 1:
+          oled.writeString(3, 1, "esperando caja");
+           break; 
  }
+ }
+}
 
 
-
diff -r 7195b6d24cf4 -r ebb4b427aecc mbed.bld
--- a/mbed.bld	Tue May 23 18:39:12 2017 +0000
+++ b/mbed.bld	Thu Nov 02 20:37:20 2017 +0000
@@ -1,1 +1,1 @@
-https://mbed.org/users/mbed_official/code/mbed/builds/4eea097334d6
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file