Hi All,
I’ve just started playing with my Wemos and a I2C 128x64 screen
I wanted to make a coin ticker as in several post but was unable to get any to work, they either needed a esp8266 dev board or just failed to compile.
So the best approach is to write my own but using other scripts as a reference, this way I learn how it works and hopefully increases my skills. The first problem is the number of resources is overwhelming, and none seem to have the info I need.
// Libraries
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 0 // GPIO0
Adafruit_SSD1306 OLED(OLED_RESET);
// WiFi settings
const char* ssid = "mywifi";
const char* password = "mypasswd";
void setup() {
// Serial
Serial.begin(115200);
delay(10);
// Initialize display
OLED.begin();
OLED.clearDisplay();
//Add stuff into the 'display buffer'
OLED.setTextWrap(false);
OLED.setTextSize(1);
OLED.setTextColor(WHITE);
OLED.setCursor(0,0);
// We start by connecting to a WiFi network
OLED.println("Connecting to ");
OLED.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
OLED.println(".");
OLED.clear();
}
OLED.println("");
OLED.println("WiFi connected");
OLED.println("IP address: ");
OLED.println(WiFi.localIP());
OLED.display(); //output 'display buffer' to screen
}
void loop() {
delay(2000);
//Clear screen
OLED.println("Running Main Prog ");
OLED.println(".");
}
What I would like to happen is the screen pause after the WIFI connection with the delay and then clear / refresh the following text to appear on the top of the display. Also maybe use scrolling text for longer lines such as IP address or a url.
I can’t seem to find a resource for the OLED cmds using adafruit I know I did search but found lots of alternate LED cmds that failed on this GFX lib.
Thanks
Newbie P