Здравствуйте, помогите пожалуйста разобраться. Собрал на макетной плате "метеостанцию" на ESP-01 и Oled-1.3 Sh1106 загрузил скетч , все подключил а экран ничего не отображает.Esp-01 подключается к точке доступа телефона.Oled рабочий проверял на другом скетче.
Подключил вроде правильно -
Esp-VCC-3.3 ,
GPIO0 -SDA ,
GPIO2 -SCL ,
CH_PD - Vcc.
/**The MIT License (MIT)
Copyright (c) 2015 by Daniel Eichhorn
Changed/updated by:
Main changes are
1) Driver for OLED changed to SH1106
2) Some more data fields added to the Weather
3) Commented out "Thingspeak" function
4) Added a shutown timer (and a reset/wake button)
5) Added a shaker vibration switch to toggle weather location
Copyright (c) 2017 by Simon Jowett
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
See more at Squix – TechBlog
*/
#include <Ticker.h>
#include <JsonListener.h>
#include "SH1106.h"
#include "SH1106Ui.h"
#include "Wire.h"
#include <ESP8266WiFi.h>
#include "WundergroundClient.h"
#include "WeatherStationFonts.h"
#include "WeatherStationImages.h"
#include "TimeClient.h"
//#include "ThingspeakClient.h"
#include "DHT.h"
/***************************
* Begin Settings
**************************/
// WIFI
const char* WIFI_SSID = "AndroidAP";
const char* WIFI_PWD = "1988000088";
// Setup
const int UPDATE_INTERVAL_SECS = 10 * 60; // Update every 10 minutes
// Display Settings
const int I2C_DISPLAY_ADDRESS = 0x3d;
const int SDA_PIN = 12;
const int SDC_PIN = 13;
// TimeClient settings
const float UTC_OFFSET = 0;
float utcoh = 0;
// Wunderground Settings
const boolean IS_METRIC = true;
const String WUNDERGRROUND_API_KEY = "86d9b7fd1bd1d096e1a01cb429117558";
String WUNDERGROUND_COUNTRY = "UK";
String WUNDERGROUND_CITY = "Leeds_Bradford";
// NB!!! - if the city has a 'space' in it ie Cape Town, use an underscore _
const String city1 = "Leeds_Bradford";
const String country1 = "UK";
const String city2 = "Sydney";
const String country2 = "AU";
//Thingspeak Settings
//const String THINGSPEAK_CHANNEL_ID = "67284";
//const String THINGSPEAK_API_READ_KEY = "L2VIW20QVNZJBLAK";
// Initialize the oled display for address 0x3c or 0x3d
// sda-pin and sdc-pin
SH1106 display(I2C_DISPLAY_ADDRESS, SDA_PIN, SDC_PIN);
SH1106Ui ui ( &display );
// DHT Settings
#define DHTPIN 14 // what digital pin we're connected to.
// Uncomment whatever type you're using!
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
#define shakerPin 5 // what digital pin the shaker switch is connect to
volatile int state = LOW; // Volatile to toggls low to high and back when vibration sensor is shaken
int currState = state; // variable to compare to see if the state has changed
volatile long lastVibration = millis(); // required to debounce the shaker.
unsigned long timerSleep = 0; // timer for esp8266 shutdown
/***************************
* End Settings
**************************/
Подключил вроде правильно -
Esp-VCC-3.3 ,
GPIO0 -SDA ,
GPIO2 -SCL ,
CH_PD - Vcc.
/**The MIT License (MIT)
Copyright (c) 2015 by Daniel Eichhorn
Changed/updated by:
Main changes are
1) Driver for OLED changed to SH1106
2) Some more data fields added to the Weather
3) Commented out "Thingspeak" function
4) Added a shutown timer (and a reset/wake button)
5) Added a shaker vibration switch to toggle weather location
Copyright (c) 2017 by Simon Jowett
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
See more at Squix – TechBlog
*/
#include <Ticker.h>
#include <JsonListener.h>
#include "SH1106.h"
#include "SH1106Ui.h"
#include "Wire.h"
#include <ESP8266WiFi.h>
#include "WundergroundClient.h"
#include "WeatherStationFonts.h"
#include "WeatherStationImages.h"
#include "TimeClient.h"
//#include "ThingspeakClient.h"
#include "DHT.h"
/***************************
* Begin Settings
**************************/
// WIFI
const char* WIFI_SSID = "AndroidAP";
const char* WIFI_PWD = "1988000088";
// Setup
const int UPDATE_INTERVAL_SECS = 10 * 60; // Update every 10 minutes
// Display Settings
const int I2C_DISPLAY_ADDRESS = 0x3d;
const int SDA_PIN = 12;
const int SDC_PIN = 13;
// TimeClient settings
const float UTC_OFFSET = 0;
float utcoh = 0;
// Wunderground Settings
const boolean IS_METRIC = true;
const String WUNDERGRROUND_API_KEY = "86d9b7fd1bd1d096e1a01cb429117558";
String WUNDERGROUND_COUNTRY = "UK";
String WUNDERGROUND_CITY = "Leeds_Bradford";
// NB!!! - if the city has a 'space' in it ie Cape Town, use an underscore _
const String city1 = "Leeds_Bradford";
const String country1 = "UK";
const String city2 = "Sydney";
const String country2 = "AU";
//Thingspeak Settings
//const String THINGSPEAK_CHANNEL_ID = "67284";
//const String THINGSPEAK_API_READ_KEY = "L2VIW20QVNZJBLAK";
// Initialize the oled display for address 0x3c or 0x3d
// sda-pin and sdc-pin
SH1106 display(I2C_DISPLAY_ADDRESS, SDA_PIN, SDC_PIN);
SH1106Ui ui ( &display );
// DHT Settings
#define DHTPIN 14 // what digital pin we're connected to.
// Uncomment whatever type you're using!
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
#define shakerPin 5 // what digital pin the shaker switch is connect to
volatile int state = LOW; // Volatile to toggls low to high and back when vibration sensor is shaken
int currState = state; // variable to compare to see if the state has changed
volatile long lastVibration = millis(); // required to debounce the shaker.
unsigned long timerSleep = 0; // timer for esp8266 shutdown
/***************************
* End Settings
**************************/