I`m trying to compile a code using esp8266 and SSD1306.
And I use Adafruit_SSD1306.h library, but I get this error message
Whole code
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include <splash.h>
#include <Wire.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
char* ssid = "e-Broad690vb3th";
const char* password = "422e6a59d2";
const String endpoint = "http://api.openweathermap.org/data/2.5/weather?q=chiba,jp&APPID=";
const String key = "e8b6ba7b9f80d5870b70b44a9c08da2d";
void setup() {
Serial.begin(115200);
display.clearDisplay();
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi..");
}
Serial.println("Connected to the WiFi network");
}
void loop() {
if ((WiFi.status() == WL_CONNECTED)) {
WiFiClient client;
HTTPClient http;
http.begin(client, endpoint + key); //URLを指定
int httpCode = http.GET(); //GETリクエストを送信
if (httpCode > 0) { //返答がある場合
String payload = http.getString(); //返答(JSON形式)を取得
Serial.println(httpCode);
Serial.println(payload);
//jsonオブジェクトの作成
DynamicJsonBuffer jsonBuffer;
String json = payload;
JsonObject& weatherdata = jsonBuffer.parseObject(json);
//パースが成功したかどうかを確認
if (!weatherdata.success()) {
Serial.println("parseObject() failed");
}
//各データを抜き出し
const char* weather = weatherdata["weather"][0]["main"].as<char*>();
const double temp = weatherdata["main"]["temp"].as<double>();
//LCDに表示
display.clearDisplay();//画面を消去
//天気を表示
display.setFont(ArialMT_Plain_16);
display.drawString(0, 0, weather);
//気温を表示
display.setFont(ArialMT_Plain_24);
String temp_str = String(temp - 273.15) + "°C";
display.drawString(20, 20, temp_str);
display.display();
}
else {
Serial.println("Error on HTTP request");
}
http.endRequest(); //Free the resources
}
delay(30000); //30秒おきに更新
}