Closed b3gi closed 4 years ago
Hey,
Try moving #include
@b3gi any news ?
The cause of this error is that the Dn pin names are only defined for a subset of ESP32 and ESP8266 boards:
Compiling the examples with any other board selected will fail.
There is an easy fix though:
For ESP32 boards simply replace SSD1306 display(0x3c, D2, D1);
with SSD1306 display(0x3c, 21, 22);
and change the wiring accordingly...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
WeMos D1 R2:
//OLED myOLED(D2, D1); OLED myOLED(4, 5);
work
see https://github.com/esp8266/Arduino/blob/master/variants/d1_mini/pins_arduino.h
just use pin numbers instead
D0 = GPIO16
D1 = GPIO5
D2 = GPIO4
D3 = GPIO0
D4 = GPIO2
D5 = GPIO14
D6 = GPIO12
D7 = GPIO13
D8 = GPIO15
Hey. I ran into a problem. The program does not allow me to compile my project. An error: 'D2' was not declared in this scope.
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
define USE_DISPLAY / <-- uncomment that if you wanna use the display /
include
//include the library you need
include "SSD1306.h"
//#include "SH1106.h"
//button pins
define upBtn D6
define downBtn D7
define selectBtn D5
define buttonDelay 180 //delay in ms
//render settings
define fontSize 8
define rowsPerSite 8
//create display(Adr, SDA-pin, SCL-pin) SSD1306 display(0x3c, D2, D1); //SH1106 display(0x3c, D2, D1);
Error: esp8266_deauther:61: error: 'D2' was not declared in this scope
esp8266_deauther:61: error: 'D1' was not declared in this scope
C:\Users\Григорий\Desktop\esp8266_deauther-master\esp8266_deauther\esp8266_deauther.ino: In function 'void setup()':
esp8266_deauther:49: error: 'D6' was not declared in this scope
C:\Users\Григорий\Desktop\esp8266_deauther-master\esp8266_deauther\esp8266_deauther.ino:377:11: note: in expansion of macro 'upBtn'
esp8266_deauther:50: error: 'D7' was not declared in this scope
C:\Users\Григорий\Desktop\esp8266_deauther-master\esp8266_deauther\esp8266_deauther.ino:378:11: note: in expansion of macro 'downBtn'
esp8266_deauther:51: error: 'D5' was not declared in this scope
C:\Users\Григорий\Desktop\esp8266_deauther-master\esp8266_deauther\esp8266_deauther.ino:379:11: note: in expansion of macro 'selectBtn'
C:\Users\Григорий\Desktop\esp8266_deauther-master\esp8266_deauther\esp8266_deauther.ino: In function 'void loop()':
esp8266_deauther:49: error: 'D6' was not declared in this scope
C:\Users\Григорий\Desktop\esp8266_deauther-master\esp8266_deauther\esp8266_deauther.ino:484:19: note: in expansion of macro 'upBtn'
esp8266_deauther:50: error: 'D7' was not declared in this scope
C:\Users\Григорий\Desktop\esp8266_deauther-master\esp8266_deauther\esp8266_deauther.ino:492:26: note: in expansion of macro 'downBtn'
esp8266_deauther:51: error: 'D5' was not declared in this scope
C:\Users\Григорий\Desktop\esp8266_deauther-master\esp8266_deauther\esp8266_deauther.ino:500:26: note: in expansion of macro 'selectBtn'
In programming, I'm not strong and generally I'm R-RUS, so if there are grammatical errors, forgive me) BYE BYE)