Skip Navigation
Arduino ecosystem @kbin.social Bizarroland @kbin.social

Default setup and screen display code for Ideaspark ESP8266-096OLED

Hey, I bought one of these off of Temu a while back and started playing with it, but the online code tutorials didn't work. The ESP8266 would connect to the web but I couldn't make the screen display anything.

After a lot of trial and error I was able to track down the listing and find the missing pieces, which were these steps:

1: Install CH340 driver
2: Install ESP8266 Board
3: Select board as NodeMcu 1.0(ESP-12E Module)
4: Install the U8g2 library by oliver
5: Set the board properties:
Upload Speed 921600
Flash Size: 4MB (FS-2MB OTA: ~1019kb)
(The other defaults were fine)

And then here is a sample code that will re-create the default screen display when flashed from the Arduino IDE:

#include <Arduino.h>
#include <Wire.h>
#include <U8g2lib.h>

U8G2_SSD1306_128X64_NONAME_F_SW_I2C
//u8g2(U8G2_R0,/'clock='/14,/'data='/12,U8X8_PIN_NONE); This is what was in the listing, but it didn't work. The next line corrects that.
u8g2(U8G2_R0,14,12,U8X8_PIN_NONE);

void setup(void) {
u8g2.begin();
}
void loop(void) {
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_6x13_tf); //This sets the font
u8g2.drawStr(0,10,"Hello,ideaspark"); // (X pos, y pos, content)
u8g2.drawStr(0,26,"ESP8266");
u8g2.drawStr(0,36,"ESP8266 0.96");
u8g2.drawStr(0,46,"ESP8266 0.96 inch");
u8g2.drawStr(0,56,"ESP8266 0.96 SSD1306");
u8g2.sendBuffer();
delay(1000);
}

Hopefully that helps someone!

1
1 comments