#define SCREEN_HEIGHT 64 // OLED display height, in pixels #define OLED_RESET 13 // 重置引脚 #define SCREEN_ADDRESS 0x3C // OLED 显示屏的地址,固化在芯片上 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_R
注意:根据自己的开发板选型 二、WiFi网络时钟+OLED 一块Esb8266 NodeMCU CH340开发版 一块0.96寸OLED 屏幕(4针) 4根杜邦线 OLED屏幕 --- ESP8266 GND --- G VCC --- 3V SCL --- D1 SDA --- D2 实物图- 一定找根带有数据传输功能的数据线接到电脑上。(上次被坑了,一直不显示串口!!) 装CH340...
5);//设置显示位置oled.println("-TonyCode-");oled.setTextSize(2);//设置字体大小oled.setCursor(15,30);//设置显示位置oled.println("OLED TEST");oled.display();// 开显示}voidloop() {}
(IPAddress &address); void oledClockDisplay(); void sendCommand(int command, int value); void initdisplay(); void connectWiFi(); void parseInfo_now(WiFiClient client,int i); void parseInfo_fut(WiFiClient client,int i); // boolean isNTPConnected = false; const unsigned char xing[] U8...
为了显示º符号,我们使用Code Page 437字体。为此,您需要将cp437设置为true,如下所示: 然后,使用write()方法显示您选择的字符。º符号对应于字符167。 使用类似的方法来显示湿度 不要忘记,您需要在最后调用display.display(),这样您才可以在OLED上实际显示某些内容。
(IPAddress &address); void oledClockDisplay(); void sendCommand(int command, int value); void initdisplay(); void connectWiFi(); void parseInfo_now(WiFiClient client,int i); void parseInfo_fut(WiFiClient client,int i); // boolean isNTPConnected = false; const unsigned char xing[] U8...
配置OLED的显示模式initDiplay或者省电模式setPowerSave,或者重置(清屏)clearDisplay 。同时检测六个按钮程序(比如前进、后退、确认、上一级…)。如果没有,可以在里定义按钮事件的引脚,用GetMenuEvent函数来定义,来进入到用户想要的界面,详情就看userInterfaceMessage和GetMenuEvent函数。无返回值。 关联使用函数:init...
128*64由I2C驱动的OLED屏幕 杜邦线若干 需要下载的程序为: uPyCraft.exe 14.4M· 百度网盘 这是一个非常适合写esp系列单片机程序的MicroPython编辑器 连接esp8266 首先我们将esp8266通过usb线连接至电脑上,并打开uPyCraft.exe 如果提示"Please install SourceCodePro font",请忽略,点击OK即可 于是我们会来到这个界面...
#define OLED_RESET -1 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); #include "images_invert.h" void setup() { Serial.begin(115200); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(F("SSD1306 allocation failed")); for(;;); }/...
[HTTP] GET... failed, error: %d\n", httpCode); } http.end(); } // OLED 显示数据 void display(long follower, long likes, long view) { u8g2.clearDisplay(); u8g2.setCursor(5, 25); u8g2.print("粉丝数:" + String(follower)); u8g2.setCursor(5, 39); u8g2.print("获赞数:...