ESP8266系列-连接OLED模块


OLED 屏幕介绍

  • 芯片型号 SSD1306
  • 分辨率 128*64
  • 供电范围 直流 3.3-5v
  • 体积 27272mm
  • 尺寸 upload successful
  • SPI 4线接法 upload successful
  • IIC 接法 upload successful

OLED与ESP8266 4线SPI接线

ESP8266 OLED
IO_12 DC
IO_13 DIN(MOSI)
IO_14 CLK
IO_15 RST
GND CS

ESP8266 SPI

upload successful

U8g2库

官方api说明

  • u8g2_SetFontMode
    ```c
    /*
    set one of:
    U8G2_FONT_MODE_TRANSPARENT
    U8G2_FONT_MODE_SOLID
    U8G2_FONT_MODE_NONE
    This has been changed for the new font procedures

*/
void u8g2_SetFontMode(u8g2_t *u8g2, uint8_t is_transparent)

**说明:**定义字形和字符串绘制函数是否写入背景色(模式0 / solid,is_transparent = 0)或不写入背景颜色(模式1 /透明,is_transparent = 1)。 默认模式为0(字符的背景颜色被覆盖)。

- u8g2_SetFontDirection

void u8g2_SetFontDirection(u8g2_t *u8g2, uint8_t dir)

```

取模软件

天气获取API

http://wthrcdn.etouch.cn/WeatherApi?city=%E5%B9%BF%E5%B7%9E

參考


文章作者: Alex.Lin
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Alex.Lin !
  目录