四针角oled屏连接arduino_arduino驱动oled

/*********************************************************************

This is an example for our Monochrome OLEDs based on SSD1306 drivers

Pick one up today in the adafruit shop!

------> http://www.adafruit.com/category/63_98

This example is for a 128x64 size display using I2C to communicate

3 pins are required to interface (2 I2C and one reset)

Adafruit invests time and resources providing this open source code,

please support Adafruit and open-source hardware by purchasing

products from Adafruit!

Written by Limor Fried/Ladyada  for Adafruit Industries.

BSD license, check license.txt for more information

All text above, and the splash screen must be included in any redistribution

*********************************************************************/

#include 

#include 

#include 

#include 

#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

static const unsigned char PROGMEM logo16_glcd_bmp[] =

{ B00000000, B11000000,

B00000001, B11000000,

B00000001, B11000000,

B00000011, B11100000,

B11110011, B11100000,

B11111110, B11111000,

B01111110, B11111111,

B00110011, B10011111,

B00011111, B11111100,

B00001101, B01110000,

B00011011, B10100000,

B00111111, B11100000,

B00111111, B11110000,

B01111100, B11110000,

B01110000, B01110000,

B00000000, B00110000 };

#if (SSD1306_LCDHEIGHT != 64)

#error("Height incorrect, please fix Adafruit_SSD1306.h!");

#endif

void setup()   {

Serial.begin(9600);

// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)

display.begin(SSD1306_SWITCHCAPVCC, 0x3D);  // initialize with the I2C addr 0x3D (for the 128x64)

// init done

// Show image buffer on the display hardware.

// Since the buffer is intialized with an 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值