Arduino 库 U8g2 可以从 Arduino IDE 的库管理器中安装。U8g2 还包含 U8x8 库: U8g2 包含了所有图形处理程序(如线/框/圆绘制)。 支持多种字体。对字体高度(几乎)没有限制。 在微控制器中需要一些内存来渲染显示屏。 U8x8 仅支持文本输出(字符)设备。
Step 2. Open the Arduino IDE and create a new file, then copy the following code into the new file. #include <Arduino.h>#include <U8g2lib.h>#ifdef U8X8_HAVE_HW_SPI#include <SPI.h>#endif#ifdef U8X8_HAVE_HW_I2C#include <Wire.h>#endifU8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g...
If your board is ATmega328, such as Seeeduino V4.2 and Arduino UNO, you need tochange to soft I2Cwhen using the U8G2 library.This is not required if you are using a SAMD development board. Application Electronic Products Medical apparatus and equipment ...