// If using software SPI (the default case): #defineOLED_MOSI 11 #defineOLED_CLK 13 #defineOLED_DC 7 #defineOLED_CS 6 #defineOLED_RESET 8 Adafruit_SSD1306display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS); /* Uncomment this block to use hardware SPI #define OLED_DC 6 #...
#include <Adafruit_SSD1306.h> #define OLED_RESET 4 Adafruit_SSD1306 display(128, 64, &Wire, OLED_RESET); //用字模工具取模显示,取模方式:C51格式,横向取模 //取16X16汉字字模 逐行式 顺向高位在前 static const unsigned char PROGMEM str1[] = { /*-- 文字: 国 --*/ /*-- Fixedsys12;...
#define OLED_RESET -1 // Use default reset pin #define SCREEN_ADDRESS 0x3C // Initialize OLED display Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // Define direction enumeration enum Direction { LEFT, RIGHT, UP, DOWN }; // Enemy structure struct Enemy { in...
一般OLED屏幕都会有一套相配套的程序库,比较主流的是Adafruit_GFX、Adafruit_SSD1306库和u8g、u8g2。我本人必要愿意用u8g系列的库。因为它功能强大。 今天,我们先来以SSD1306芯片的12864屏幕为例,介绍Adafruit系列库的使用。 Adafruit_GFX和Adafruit_SSD1306 有什么关系呢? Adafruit_GFX定义了一系列的绘画方法(线,...
#define OLED_RESET 4 Adafruit_SSD1306 display(OLED_RESET); #define NUMFLAKES 10 #define XPOS 0 #define YPOS 1 #define DELTAY 2 #define LOGO16_GLCD_HEIGHT 16 #define LOGO16_GLCD_WIDTH 16 #if (SSD1306_LCDHEIGHT != 64) #error("Height incorrect, please fix Adafruit_SSD1306.h!"); ...
* 功能:OLED12864 SSD1306测试 * 作者:单片机菜鸟 * 16X16点阵显示 取模方式 阴码+逐行式+顺向 **/#include<Wire.h>#include<Adafruit_GFX.h>#include<Adafruit_SSD1306.h>#defineOLED_RESET 4Adafruit_SSD1306 display(OLED_RESET);#defineNUMFLAKES 10#defineXPOS 0#defineYPOS 1#defineDELTAY 2#defineLO...
#include<Wire.h>#include<Adafruit_SSD1306.h>#defineOLED_RESET -1// Reset pin # (or -1 if sharing Arduino reset pin)Adafruit_SSD1306display(/*SCREEN_WIDTH*/128,/*SCREEN_HEIGHT*/64,&Wire,OLED_RESET); setup函数中 voidsetup(){Wire.begin(/*SDA*/12,/*SCL*/14);// SSD1306_SWITCHCAPVC...
Adafruit_SSD1306 oled(128, 64, &Wire,-1); void setup() { oled.begin(SSD1306_SWITCHCAPVCC,0x3C); oled.setTextColor(WHITE);//开像素点发光 oled.clearDisplay();//清屏 oled.setTextSize(1); //设置字体大小 oled.setCursor(35, 5);//设置显示位置 ...
硬件:ESP8266+OLED开发板软件平台:VSCode+PlatformIO+Arduino开源地址:https://github.com/zhuhai-esp/ESP8266-OLED096-Project开源库:https://github.com/adafruit/Adafruit_SSD1306开源库:https://github.com/olikraus/u8g2OLED开源在线时钟, 视频播放量 3050、弹幕
importboardimportdisplayioimportadafruit_displayio_ssd1306importbusiodisplayio.release_displays()# This pinout works on a Metro and may need to be altered for other boards.spi=busio.SPI(board.SCL,board.SDA)tft_cs=board.D9tft_dc=board.D8tft_reset=board.D7display_bus=displayio.FourWire(spi,co...