McLighting icon indicating copy to clipboard operation
McLighting copied to clipboard

Oled Support

Open BobTheShoplifter opened this issue 6 years ago • 9 comments

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

BobTheShoplifter avatar May 07 '18 10:05 BobTheShoplifter

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.

TechOnlyGamer avatar May 07 '18 10:05 TechOnlyGamer

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

BobTheShoplifter avatar May 07 '18 10:05 BobTheShoplifter

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

debsahu avatar May 08 '18 17:05 debsahu

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

toblum avatar May 10 '18 15:05 toblum

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


From: Tobias Blum [email protected] 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.

BobTheShoplifter avatar May 10 '18 15:05 BobTheShoplifter

Any news on this ?

thundergreen avatar Jul 04 '18 17:07 thundergreen

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

toblum avatar Jul 04 '18 17:07 toblum

@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.

debsahu avatar Jul 04 '18 17:07 debsahu

@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. :-)

toblum avatar Jul 04 '18 18:07 toblum