toblum / McLighting

The ESP8266 based multi-client lighting gadget
MIT License
1.05k stars 289 forks source link

Oled Support #162

Open BobTheShoplifter opened 6 years ago

BobTheShoplifter commented 6 years ago

Is it possible to support oled? Like when its just started it says "Connect to " And when its online it says "Running on " And when starting it says If so what oled display do i need to buy?

TechOnlyGamer commented 6 years ago

that is really a great idea. i saw an esp32 a while ago with integrated oled. so if this project gets compatible with it we could see Informationen like ip address or some cool things like that.

BobTheShoplifter commented 6 years ago

Yes i want to be able to have it in the front/top of the case i am making but i think it should not be that hard to add to the code

debsahu commented 6 years ago

I have some SSD1306 OLED displays that work really well with ESP8266. Remember to add 4.7k pull up resistors on SDA and SCL. I haven't tried it with McLighting but here is the code you are looking for:

#include <SSD1306.h>  // https://github.com/ThingPulse/esp8266-oled-ssd1306

SSD1306  display(0x3c, D2, D1); // SDA = D2, SCL = D1

void displayInit() {
  display.init();
  display.flipScreenVertically();
  display.setFont(ArialMT_Plain_24);
}

void displayInt(double dispInt, int x, int y) {
  //display.setColor(WHITE);
  display.setTextAlignment(TEXT_ALIGN_CENTER);
  display.drawString(x, y, String(dispInt));
  display.setFont(ArialMT_Plain_24);
  display.display();
}

void displayString(String dispString, int x, int y) {
  //display.setColor(WHITE);
  display.setTextAlignment(TEXT_ALIGN_CENTER);
  display.drawString(x, y, dispString);
  display.setFont(ArialMT_Plain_24);
  display.display();
}

setup() {
  displayInit();
  displayString("Welcome", 64, 15);
}

And of course go through some examples in ThingPlus SSD1306 library

toblum commented 6 years ago

Hi @gabenthegamer,

nice idea. I think the SSD1306 is the best pick. Cheap reliable and supports I2C. I used these before with the Adafruit library https://github.com/adafruit/Adafruit_SSD1306. It shouldn't be too complicated to use these to display status information. I ordered two, will try that out someday later.

Regards Tobias

BobTheShoplifter commented 6 years ago

Thanks! Tell me if you get it to work an what screen ordered


From: Tobias Blum notifications@github.com Sent: Thursday, May 10, 2018 5:40:30 PM To: toblum/McLighting Cc: Daniel; Mention Subject: Re: [toblum/McLighting] Oled Support (#162)

Hi @gabenthegamerhttps://github.com/gabenthegamer,

nice idea. I think the SSD1306 is the best pick. Cheap reliable and supports I2C. I used these before with the Adafruit library https://github.com/adafruit/Adafruit_SSD1306. It shouldn't be too complicated to use these to display status information. I ordered two, will try that out someday later.

Regards Tobias

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/toblum/McLighting/issues/162#issuecomment-388092670, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVg7O4O91x2tjIqgf8mUrSL30nHIpY25ks5txF9ugaJpZM4T0uqt.

thundergreen commented 6 years ago

Any news on this ?

toblum commented 6 years ago

Hi, I didn‘t find time yet to look into this. The new Displays also did not arrive yet. Regards Tobias

debsahu commented 6 years ago

@toblum I have these SSD1306 displays, I can whip something out if this is a priority? Currently busy with Google cloud stuff, once I figure that out I can work on this.

toblum commented 6 years ago

@debsahu No priorities at all, I would say. Just work on what you enjoy the most.

But this shouldn't be too complicated, I think. I did this before, but my current displays are glued to their enclosure in other projects I'm doing. :-)