// 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;...
display.fillRect(0,0,64,64,WHITE); //画空心圆 display.clearDisplay(); display.drawCircle(20,20,20,WHITE); //画实心圆 display.clearDisplay(); display.fillCircle(20,20,20,WHITE); //画空心三角形 display.clearDisplay(); display.drawTriangle(20,0,0,20,40,20,WHITE); //画实心三角形 di...
display.fillCircle(20,20,20,WHITE); display.display(); delay(2000); //画空心三角形 display.clearDisplay(); display.drawTriangle(20,0,0 把这段代码烧录到arduino内,运行后观察结果。 先弄清楚OLED 屏幕的坐标系统 这其实就是一个128(width)X64(height)点阵。在坐标系中,左上角是原点,向右是X轴,向...
#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...
* 功能: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...
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...
SSD1306 128x64 Wiring guide // If using software SPI (the default case): #define OLED_MOSI D0 #define OLED_CLK D1 #define OLED_DC D2 #define OLED_CS D3 #define OLED_RESET D4 Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS); About...
reset pin).@param cs_pin Chip-select pin (using Arduino pin numbering) for sharing the bus with other devices. Active low.@param bitrate SPI clock rate for transfers to this display. Default if unspecified is 8000000UL (8 MHz).@return Adafruit_SSD1306 object.@...
// If not using a reset pin, use -1. Only some displays need a reset pin. Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { // Initialize the OLED display. if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // 0x3C is the I2C address for ...