Top 7 아두 이노 Oled Best 268 Answer

You are looking for information, articles, knowledge about the topic nail salons open on sunday near me 아두 이노 oled on Google, you do not find the information you need! Here are the best content compiled and compiled by the https://chewathai27.com/to team, along with other related topics such as: 아두 이노 oled 아두이노 oled 글자 출력, 아두이노 oled i2c, 아두이노 oled 테트리스, Arduino OLED, 아두이노 oled 오류, 아두이노 디스플레이, I2c oled display, 아두이노 lcd


【 아두이노 완공#25】 OLED 처음사용설명서#1 (SPI, I2C 5종 사용법 안내) @ 문자 로고 출력(How to use Arduino OLED Text Logo)
【 아두이노 완공#25】 OLED 처음사용설명서#1 (SPI, I2C 5종 사용법 안내) @ 문자 로고 출력(How to use Arduino OLED Text Logo)


아두이노로 0.96인치 OLED디스플레이(SSD1306) 사용하기 : 네이버 블로그

  • Article author: blog.naver.com
  • Reviews from users: 3465 ⭐ Ratings
  • Top rated: 4.3 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about 아두이노로 0.96인치 OLED디스플레이(SSD1306) 사용하기 : 네이버 블로그 0.96인치 외에도 OLED 디스플레이 모듈은 다양한 사이즈와 색상으로 출시되고 있습니다. 아두이노를 사용한 프로젝트에 많이 사용되는 0.96인치 OLED는 … …
  • Most searched keywords: Whether you are looking for 아두이노로 0.96인치 OLED디스플레이(SSD1306) 사용하기 : 네이버 블로그 0.96인치 외에도 OLED 디스플레이 모듈은 다양한 사이즈와 색상으로 출시되고 있습니다. 아두이노를 사용한 프로젝트에 많이 사용되는 0.96인치 OLED는 …
  • Table of Contents:

블로그

악성코드가 포함되어 있는 파일입니다

작성자 이외의 방문자에게는 이용이 제한되었습니다

아두이노로 0.96인치 OLED디스플레이(SSD1306) 사용하기 : 네이버 블로그
아두이노로 0.96인치 OLED디스플레이(SSD1306) 사용하기 : 네이버 블로그

Read More

라즈이노 iOT :: 【 아두이노모듈#29】 OLED 처음 사용 설명서 #1 (SPI, I2C 주요 5종 사용법 안내)

  • Article author: rasino.tistory.com
  • Reviews from users: 23166 ⭐ Ratings
  • Top rated: 4.5 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about 라즈이노 iOT :: 【 아두이노모듈#29】 OLED 처음 사용 설명서 #1 (SPI, I2C 주요 5종 사용법 안내) 이번 시간에는 아두이노를 가지고 응용작품을 만들때 활용하기 좋은 OLED의 사용법을 다루어 볼게요. OLED는 무턱대고 사용해보려 한다면, … …
  • Most searched keywords: Whether you are looking for 라즈이노 iOT :: 【 아두이노모듈#29】 OLED 처음 사용 설명서 #1 (SPI, I2C 주요 5종 사용법 안내) 이번 시간에는 아두이노를 가지고 응용작품을 만들때 활용하기 좋은 OLED의 사용법을 다루어 볼게요. OLED는 무턱대고 사용해보려 한다면, … 【 아두이노모듈#29】 OLED 처음 사용 설명서 #1 (SPI, I2C 주요 5종 사용법 안내) (본문의 모든이미지는 클릭하면 확대하여 볼 수 있습니다)  이번 시간에는 아두이노를 가지고 응용작품을 만들때 활용하기 좋..
  • Table of Contents:

【 아두이노모듈#29】 OLED 처음 사용 설명서 #1 (SPI I2C 주요 5종 사용법 안내)

티스토리툴바

라즈이노 iOT :: 【 아두이노모듈#29】 OLED 처음 사용 설명서 #1 (SPI, I2C 주요 5종 사용법 안내)
라즈이노 iOT :: 【 아두이노모듈#29】 OLED 처음 사용 설명서 #1 (SPI, I2C 주요 5종 사용법 안내)

Read More

Guide for I2C OLED Display with Arduino | Random Nerd Tutorials

  • Article author: randomnerdtutorials.com
  • Reviews from users: 16662 ⭐ Ratings
  • Top rated: 4.7 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about Guide for I2C OLED Display with Arduino | Random Nerd Tutorials Learn how to use the SSD1306 0.96 inch I2C OLED display with Arduino. We’ll also build a project example that displays temperature and humity readings. …
  • Most searched keywords: Whether you are looking for Guide for I2C OLED Display with Arduino | Random Nerd Tutorials Learn how to use the SSD1306 0.96 inch I2C OLED display with Arduino. We’ll also build a project example that displays temperature and humity readings. Learn how to use the SSD1306 0.96 inch I2C OLED display with Arduino. We’ll also build a project example that displays temperature and humidity readings.guide for oled display arduino,arduino oled display library,oled display module with arduino,small oled display,oled display with arduino temperature and humidity
  • Table of Contents:

Introducing the 096 inch OLED display

Pin wiring

Libraries

Testing the OLED Display

Write Text – OLED Display

Using Other Fonts – OLED Display

Draw Shapes in the OLED Display

Display Bitmap Images in the OLED

Display Temperature and Humidity in the OLED Display with Arduino

Demonstration

Troubleshooting

Wrapping Up

Download our Free eBooks and Resources

Guide for I2C OLED Display with Arduino | Random Nerd Tutorials
Guide for I2C OLED Display with Arduino | Random Nerd Tutorials

Read More

0.96 inch OLED 디스플레이 구동하기

  • Article author: diy-dev-design.tistory.com
  • Reviews from users: 15665 ⭐ Ratings
  • Top rated: 4.0 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about 0.96 inch OLED 디스플레이 구동하기 아두이노 나노 Arduino Nano (우노가 있으신 분은 그냥 우노로 하시면 됩니다) · 0.96 inch OLED display (128×64). …
  • Most searched keywords: Whether you are looking for 0.96 inch OLED 디스플레이 구동하기 아두이노 나노 Arduino Nano (우노가 있으신 분은 그냥 우노로 하시면 됩니다) · 0.96 inch OLED display (128×64). 가끔 아두이노로 무엇인가를 만들어 보려고 하다보면 디스플레이가 있으면 하는 생각이 들때가 있습니다. 아두이노는 작은 컴퓨터이기는 하지만 모름지기 컴퓨터라 한다면 입력장치 – 중앙처리장치 – 출력장치가..
  • Table of Contents:

태그

관련글

댓글0

공지사항

최근글

인기글

최근댓글

태그

티스토리툴바

0.96 inch OLED 디스플레이 구동하기
0.96 inch OLED 디스플레이 구동하기

Read More

G마켓 – 아두이노 oled 검색결과

  • Article author: browse.gmarket.co.kr
  • Reviews from users: 24440 ⭐ Ratings
  • Top rated: 3.8 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about G마켓 – 아두이노 oled 검색결과 상품명 (오너클랜) IoT 개발보드 ESP32 블루투스 OLED WIFI 32 아두이노. 상품금액 96,430원. 무료배송. 판매자신세계몰. 판매자평가정보. 파워딜러. 고객만족우수. …
  • Most searched keywords: Whether you are looking for G마켓 – 아두이노 oled 검색결과 상품명 (오너클랜) IoT 개발보드 ESP32 블루투스 OLED WIFI 32 아두이노. 상품금액 96,430원. 무료배송. 판매자신세계몰. 판매자평가정보. 파워딜러. 고객만족우수. G마켓 내 아두이노 oled 검색결과입니다.아두이노 oled
  • Table of Contents:

OLED 128×64 096인치 I2C 4핀 납땜 아두이노 LCD DIY 연관상품 47개연관상품 닫기

OLED 128×64 096인치 I2C 4핀 아두이노 LCD 화면 DIY 연관상품 47개연관상품 닫기

091인치 IIC I2C OLED 디스플레이 PIC 모듈 연관상품 42개연관상품 닫기

OLED 128×64 096인치 SPI 7핀 납땜 아두이노 LCD DIY 연관상품 47개연관상품 닫기

091인치 IIC I2C OLED 디스플레이 PIC 모듈 연관상품 42개연관상품 닫기

IoT 개발보드 ESP32 블루투스 OLED WIFI 32 아두이노 연관상품 8개연관상품 닫기

096인치 OLED X- 배터리 백플레인 확장 보드 세트 ES 연관상품 14개연관상품 닫기

242인치 OLED 128X64 디스플레이 스크린 SSD1309IC 2 연관상품 42개연관상품 닫기

23 096 OLED 모듈 4포트 아두이노 베스트 부품 연관상품 42개연관상품 닫기

OLED 128×64 096인치 I2C 4핀 납땜 아두이노 LCD DIY 연관상품 47개연관상품 닫기

OLED 128×64 096인치 I2C 4핀 아두이노 LCD 화면 DIY 연관상품 47개연관상품 닫기

OLED 128×64 096인치 SPI 7핀 납땜 아두이노 LCD DIY 연관상품 47개연관상품 닫기

ESP8266 Node MCU+OLED 096인치 보드 아두이노 WiFi 연관상품 47개연관상품 닫기

아두이노 OLED 096인치 128×64 I2C 4핀 A36 연관상품 6개연관상품 닫기

아두이노 OLED 13인치 128×64 I2C 4핀 A38-1 연관상품 6개연관상품 닫기

아두이노 OLED 095인치 7핀 SPI 컬러 A60 연관상품 6개연관상품 닫기

아두이노 OLED 096인치 128×64 SPI 6핀 A37 연관상품 6개연관상품 닫기

아두이노 OLED 13인치 128X64 SPI 6핀 A38 연관상품 6개연관상품 닫기

아두이노 OLED 13인치 128×64 SPI7핀A38-2 연관상품 6개연관상품 닫기

아두이노096인치 OLED 12864 연관상품 11개연관상품 닫기

G마켓 - 아두이노 oled 검색결과
G마켓 – 아두이노 oled 검색결과

Read More

12. 아두이노 IIC OLED 간단 제어하기 : 코딩나우

  • Article author: www.codingnow.co.kr
  • Reviews from users: 30600 ⭐ Ratings
  • Top rated: 4.0 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about 12. 아두이노 IIC OLED 간단 제어하기 : 코딩나우 아두이노 스케치을 열어서 라이브러리를 설치합니다. 라이브러리 검색은 adafruit ssd로 검색하여 설치합니다. 강의에 사용되었던 주요 소스 코드입니다. …
  • Most searched keywords: Whether you are looking for 12. 아두이노 IIC OLED 간단 제어하기 : 코딩나우 아두이노 스케치을 열어서 라이브러리를 설치합니다. 라이브러리 검색은 adafruit ssd로 검색하여 설치합니다. 강의에 사용되었던 주요 소스 코드입니다. 개발자의 기본 덕목은 포기하지 않기 입니다.강의 소스 서버 git : https://github.com/cflab2017/codingnow.git 프로그래밍 언어 강의입니다. 파이썬, C언어, 아두이노, 개발의뢰
  • Table of Contents:
12. 아두이노 IIC OLED 간단 제어하기 : 코딩나우
12. 아두이노 IIC OLED 간단 제어하기 : 코딩나우

Read More

Arduino – OLED | Arduino Tutorial

  • Article author: arduinogetstarted.com
  • Reviews from users: 14203 ⭐ Ratings
  • Top rated: 4.3 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about Arduino – OLED | Arduino Tutorial Arduino – OLED … The OLED (Organic Light-Emitting Diode) display is an alternative for LCD display. The OLED is super-light, almost paper-thin, flexible, and … …
  • Most searched keywords: Whether you are looking for Arduino – OLED | Arduino Tutorial Arduino – OLED … The OLED (Organic Light-Emitting Diode) display is an alternative for LCD display. The OLED is super-light, almost paper-thin, flexible, and … Learn how to use OLED display with Arduino, how to display text, number on OLED, how to draw on OLED, how to display image on OLED, how to connect OLED to Arduino, how to code for OLED, how to program Arduino step by step. The detail instruction, code, wiring diagram, video tutorial, line-by-line code explanation are provided to help you quickly get started with Arduino. Find this and other Arduino tutorials on ArduinoGetStarted.com.arduino Arduino,arduino Arduino tutorial,arduino Arduino project,arduino Arduino wiring,arduino Arduino wiring diagram,arduino Arduino schematic,arduino Arduino code,arduino Arduino example,arduino Arduino example code,Arduino arduino,Arduino arduino tutorial,Arduino arduino project,Arduino arduino wiring,Arduino arduino wiring diagram,Arduino arduino schematic,Arduino arduino code,Arduino arduino example,Arduino arduino example code,Arduino pinout,how Arduino works,how to use Arduino,arduino with Arduino,arduino OLED,arduino OLED tutorial,arduino OLED project,arduino OLED wiring,arduino OLED wiring diagram,arduino OLED schematic,arduino OLED code,arduino OLED example,arduino OLED example code,OLED arduino,OLED arduino tutorial,OLED arduino project,OLED arduino wiring,OLED arduino wiring diagram,OLED arduino schematic,OLED arduino code,OLED arduino example,OLED arduino example code,OLED pinout,how OLED works,how to use OLED,arduino with OLED,Arduino OLED
  • Table of Contents:

Hardware Required

About OLED Display

Wiring Diagram

How To Use OLED with Arduino

Arduino Code – Display Text on OLED

How to vertical and horizontal center align textnumber on OLED

Arduino Code – Drawing on OLED

Arduino Code – Display Image

OLED Troubleshooting

Arduino - OLED | Arduino Tutorial
Arduino – OLED | Arduino Tutorial

Read More

아두이노 따라하기_02_128x64 I2C OLED 구동하기

  • Article author: masnus.tistory.com
  • Reviews from users: 10897 ⭐ Ratings
  • Top rated: 4.0 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about 아두이노 따라하기_02_128x64 I2C OLED 구동하기 128×64 I2C OLED를 아두이노 우노 보드에서 구동시키는 방법입니다. … SSD1306 driver를 IC를 사용하고 128X64 OLED는 동일하지만 만드는 회사마다, … …
  • Most searched keywords: Whether you are looking for 아두이노 따라하기_02_128x64 I2C OLED 구동하기 128×64 I2C OLED를 아두이노 우노 보드에서 구동시키는 방법입니다. … SSD1306 driver를 IC를 사용하고 128X64 OLED는 동일하지만 만드는 회사마다, … 128×64 I2C OLED를 아두이노 우노 보드에서 구동시키는 방법입니다. ●준비물  -. 아두이노 우노  -. 128×64 I2C OLED  -. Wire  -. bread board(wire만으로도 연결가능) ●제품 사양  -. interface : I2C(동..
  • Table of Contents:

태그

‘상상 Maker Space and US’ Related Articles

티스토리툴바

아두이노 따라하기_02_128x64 I2C OLED 구동하기
아두이노 따라하기_02_128x64 I2C OLED 구동하기

Read More

014. Arduino 아두이노 – 0.96″ OLED 모듈 사용하기

  • Article author: zelkun.tistory.com
  • Reviews from users: 19796 ⭐ Ratings
  • Top rated: 4.2 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about 014. Arduino 아두이노 – 0.96″ OLED 모듈 사용하기 OLED(Organic Light Emitting Diode)를 이용해볼거에요 128×64 픽셀로 예전 노키아 휴대폰에 쓰던 액정 모듈이라네요 OLED arduino GND GND VCC 5v … …
  • Most searched keywords: Whether you are looking for 014. Arduino 아두이노 – 0.96″ OLED 모듈 사용하기 OLED(Organic Light Emitting Diode)를 이용해볼거에요 128×64 픽셀로 예전 노키아 휴대폰에 쓰던 액정 모듈이라네요 OLED arduino GND GND VCC 5v … OLED(Organic Light Emitting Diode)를 이용해볼거에요 128×64 픽셀로 예전 노키아 휴대폰에 쓰던 액정 모듈이라네요     OLED arduino GND GND VCC 5v SDA(Serial Data Line) A4 & SDA SCL(Serial CLock) A5 &..
  • Table of Contents:

고정 헤더 영역

메뉴 레이어

검색 레이어

상세 컨텐츠

태그

추가 정보

페이징

티스토리툴바

014. Arduino 아두이노 - 0.96
014. Arduino 아두이노 – 0.96″ OLED 모듈 사용하기

Read More


See more articles in the same category here: https://chewathai27.com/to/blog.

아두이노로 0.96인치 OLED디스플레이(SSD1306) 사용하기

아두이노 아두이노로 0.96인치 OLED디스플레이(SSD1306) 사용하기 황제곰 ・ URL 복사 본문 기타 기능 공유하기 신고하기 0.96인치 OLED 디스플레이 사용하기 ​ 안녕하세요. 이번포스팅에서에는 아두이노로 0.96인치 OLED 디스플레이를 제어하는 방법에 대해서 알아보도록 하겠습니다. 0.96인치 OLED 디스플레이 모듈(Blue) 아두이노 라즈베리파이 호환 : 베어팹몰 0.96인치 OLED 디스플레이 모듈(Blue) 아두이노 라즈베리파이 호환 smartstore.naver.com ​ OLED 디스플레이 모듈 이번 포스팅에서 사용할 OLED 디스플레이 모듈은 아래 사진같이 크기가 0.96인치 입니다. 0.96인치 외에도 OLED 디스플레이 모듈은 다양한 사이즈와 색상으로 출시되고 있습니다. 아두이노를 사용한 프로젝트에 많이 사용되는 0.96인치 OLED는 128×64픽셀로 이루어져 있으며 이보다 작은 0.91인치 OLED는 128×32픽셀로 이루어져 있습니다. ​ 0.96인치 ​ ​ 0.91인치 ​ 흰색 OLED ​ ​ 이 모듈은 SSD1306이라는 OLED 구동용 IC 칩에 의해 구동되는데 이 IC칩은 마이크로컨트롤러와 통신하기 위해 I2C와 SPI통신을 지원합니다. 하지만 판매되고 있는 모듈은 대부분 두가지 통신 모드중 하나의 방식의 포트만 노출시켜 판매되기 때문에 둘중에 원하는 방식을 구입하시면 됩니다. 물론 두가지 방식을 모두 지원하는 모듈도 판매되고 있습니다. 이번 포스팅에서는 i2C 방식을 사용해 보겠습니다 I2C 방식(좌)과 SPI 방식(우) ​ 0.96인치 oled 모듈(SSD1306)의 스펙은 아래와 같습니다. 디스플레이 방식 OLED (Organic LED) 인터페이스 I2C / SPI 스크린사이즈 0.96 인치 해상도 128×64 pixels 동작전압 3.3V – 5V 동작전류 20mA max 시야각 160° ​ OLED 모듈에서 사용하는 SSD1306 드라이버 칩은 내부에 1KB용량의 그래픽 디스플레이 전용 램(GDDRAM)이 내장되어 있어서 디스플레이 패널에 표시할 비트패턴을 저장하는 방식으로 동작합니다. 이 1K 메모리용량은 8개의 페이지(0-7번)으로 이루어져 있고 8개의 페이지는 각각 128개의 세로 줄(0-127번)로 구성되어 있습니다. 각각의 세로줄은 8개의 비트정보(0-7번)를 저장할 수 있기 때문에 이를 계산해보면 ​ 8페이지 x 128 개의 세로줄 x 8비트 데이타 = 8192비트 = 1024바이트 = 1KB 메모리 용량 ​ 이 됩니다. ​ 위에서 말한 페이지, 세로줄, 세로줄의 비트를 그림으로 표현하면 아래와 같습니다. SSD1306의 메모리 표현 ​ 위 그림에서 작은 사각형 하나는 OLED의 램에 저장된 데이터정보를 표시하는 픽셀의 기능을 합니다. 128×64 OLED스크린은 전체 램의 용량을 다 사용하지만 128x32OLED는 4페이지까지만 있기 때문에 전체 램 용량중 반만 사용하게 됩니다. 회로연결 아두이노버전에 따라 I2C 연결용 핀이 다르기 때문에 사용하시는 아두이노 모델에따라 OLED 모듈의 SCL, SDA핀을 아두이노의 SCL, SDA핀과 연결하면 됩니다. 아두이노 SCL SDA 아두이노 우노 A5 A4 아두이노 나노 A5 A4 아두이노 메가 21 20 레오나르도/마이크로 3 2 OLED모듈의 VCC핀과 GND 핀은 각각 아두이노의 5V, GND 핀과 연결하면됩니다. 아두이노 우노버전을 기준으로 아래 그림과 같이 연결하면 됩니다. ​ 라이브러리 설치하기 SSD1306을 라이브러리 없이 직접제어하는 것은 상당히 복잡하기 때문에 대부분 OLED모듈을 제어할 때는 라이브러리를 사용하게 되는데요. SSD1306제어용 라이브러리는 여러 종류가 있습니다. 그 중에서 가장 많이 사용되는 Adafruit사의 라이브러리를 설치해 보도록 하겠습니다. ​ 우선 라이브러리 설치를 위해 [스케치]-[라이브러리 포함하기]-[라이브러리 관리]를 눌러 줍니다. 그리고 아래그림과 같이 라이브러리 매니저가 뜨면 adafruit gfx 라고 입력하고 해당 라이브버리를 설치해 줍니다. 이 라이브러리는 adafruit의 디스플레이 모듈의 그래픽 관련 처리를 도와주는 라이브러리라고 합니다. adafruit의 ssd1306의 동작에도 활용되기 때문에 설치가 필요합니다. 두번째로 adafruit ssd1306라이브러리를 설치해 줍니다. 아래 사진과 같이 adafruit ssd1306을 입력해 해당 라이브러리를 설치하면 됩니다. 예제 실행해보기 이제 제대로 동작하는지 확인하기 위해서 라이브러리의 예제를 실행해 보겠습니다. 아래 사진과 같이 [파일]-[예제]-[Adafruit SSD1306]-[ssd1306_128_64_i2c]를 클릭해서 예제 파일을 열어 줍니다. 스케치 파일에 보면 display.begin( )함수에 주소가 0x3D로 기본으로 설정되어 있는데 자신이 사용하는 모듈의 I2C주소로 바꿔 줘야 합니다. 이번 포스팅에서 사용한 모듈은 I2C 주소가 0x3C이기 떄문에 아래와 같이 0x3C로 바꿔주면 됩니다. ​ 그리고 나서 스케치를 아두이노에 업로드 하면 아래 영상과 같이 예제 화면이 순서대로 순회하며 바뀌는 것을 확인 할 수 있습니다. ​ ​ 예제별 코드확인 위 예제파일은 구동여부를 확인해 보는 용도로는 좋지만 코드가 길어서 동작의 이해에는 어려움이 있습니다. oled 라이브러리의 사용법을 알아보기 위해 예제별로 코드를 하나씩 확인해 보도록 하겠습니다. ​ 아래 코드는 아래 예제에서 공통적으로 필요한 부분으로 필요한 라이브러리를 불러오고 해상도를 지정한 뒤에 디스플레이 객체를 생성하는 부분입니다. #include //i2c통신을 사용하기 때문에 아두이노의 i2c 통신용 라이브러리가 필요 #include // adafruit의 그래픽 관련 라이브러리 #include // ssd1306 제어용 라이브러리 #define SCREEN_WIDTH 128 // OLED 디스플레이의 가로 픽셀수 #define SCREEN_HEIGHT 64 // OLED 디스플레이의 세로 픽셀수 #define OLED_RESET 4 // 리셋핀이 있는 oled의 리셋핀에 연결할 아두이노의 핀 번호, 리셋핀이 없는 모듈은 임의의 숫자를 넣어도 됨. Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // 디스플레이 객체 생성 아래 부분은 OLED 모듈을 초기화 하고 OLED 모듈의 버퍼(램)을 비우는 코드 입니다. // 0x3C주소로 디스플레이 장치를 초기화 display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // 버퍼를 비움 display.clearDisplay(); ​ 이제 간단한 기능별로 코드를 살펴 보겠습니다. ​ 【문자표시하기】 – 간단한 문자 표시(Hello world!)- // 문자표시하기 display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,28); display.println(“Hello world!”); display.display(); delay(2000); 문자를 스크린에 표시하려면 폰트사이즈를 먼저 지정해 주어야 합니다. 폰트사이즈는 setTextSize( ) 함수에 폰트사이즈 값을 파라미터로 넣어 주면 되고 최소값은 1부터 시작합니다. 폰트색상는 setTextColor() 함수에 사용할 색상값을 파라미터로 입력해 주면 됩니다. 어두운 배경일 때는 WHITE를 밝은 배경일 때는 BLACK를 넣어 주면 됩니다.(사용하는 OLED모듈의 글자 색상이 파란색이어도 WHITE를 입력하면 됩니다.) 문자를 입력할 위치는 setCursor(X, Y)함수를 통해 지정할 수 있습니다. 파라미터로 입력한 X, Y의 값대로 수평으로 X, 수직을 Y의 위치에서 글자를 시작하게 됩니다. 원점인 0, 0은 OLED 모듈의 왼쪽 상단이고 +X는 오른쪽으로 +Y는 아래쪽으로 증가하는 방식으로 동작합니다. 출력할 글자는 시리얼 통신에 문자를 출력하는 방식과 마찬가지로 print(” “), 또는 println(” “)함수에 넣은 메시지를 출력합니다. 이 함수는 ATmega328내의 스크린 버퍼에 전달되어 저장되었다가 display( )함수가 호출되면 OLED모듈의 램으로 전달되어 바로 화면으로 출력이 이루어 집니다. 따라서 display( ); 함수를 사용하기 전까지는 OLED 디스플레이의 화면이 바뀌지 않습니다. ​ ​ -반전문자표시- // 반전문자표시하기 display.clearDisplay(); display.setTextColor(BLACK, WHITE); // ‘inverted’ text display.setCursor(0,28); display.println(“Hello world!”); display.display(); delay(2000); 반전문자를 표시하기 위해서는 setTextColor( ) 함수에 파라미터로 글자색상과 함께 배경색상을 지정해 주면 됩니다. 위 코드에서 입력한 BLACK, WHITE는 하얀 배경에 검정색으로 글씨를 쓰라는 의미가 되어 반전된 글자가 출력되게 됩니다. ​ -글자크기 변경- // 글자 사이즈 변경 display.clearDisplay(); display.setTextColor(WHITE); display.setCursor(0,24); display.setTextSize(2); display.println(“Hello!”); display.display(); delay(2000); 위에서 언급했다시피 글자 사이즈를 지정하는 함수는 setTextSize( )함수입니다. 위에서는 파라미터로 최소 1부터 입력할 수 있으며 음수는 음력할 수 없습니다. 여기에 넣은 숫자는 가로:세로 7:10의 비율로 확장되어 출력된다고 하는데요. 이말을 1을 입력하면 한문자당 7픽셀x10픽셀을 차지하게 된다는 의미입니다. 따라서 숫자 2를 입력하면 한문자당 14×20픽셀을 차지하게 됩니다. 문자폰트는 Adafruit_GFX에 의해 처리되는데 기본 폰트는 mono-spaced 폰트로 설정되어 있다고 합니다. 이 라이브러리를 통해 다른 폰트를 사용하거나 추가할 수 있다고 하니 폰트 변경을 원한다면 해당 라이브러리를 자세히 살펴보시면 될 것 같네요. ​ -숫자표시- // 숫자표시하기 display.clearDisplay(); display.setTextSize(1); display.setCursor(0,28); display.println(123456789); display.display(); delay(2000); 숫자는 print( ) 또는 println( ) 함수에 문자대신 숫자를 입력하면 되는데요. 파라미터는 32bit unsigned int 값을 받아 들일 수 있기 때문에 0에서 4,294,967,295.까지의 숫자를 넣을 수 있습니다. ​ -진법표시- //진법 표시하기 display.clearDisplay(); display.setCursor(0,28); display.print(“0x”); display.print(0xFF, HEX); display.print(“(HEX) = “); display.print(0xFF, DEC); display.println(“(DEC)”); display.display(); delay(2000); print( )또는 println( ) 함수에 두번째 파라미터로 표현하고 싶은 진법을 넣으면 해당 숫자와 숫자 옆에 괄호로 (진법)이 표시됩니다. 파라미터로는 2진법은 BIN, 8진법은 OCT, 십진법은 DEC, 16진법은 ​HEX​를 넣으면 됩니다. 만약 실수표현에서 두번째 파라미터로 숫자를 넣으면 소수점 뒤에 표현할 숫자의 갯수를 의미합니다. 예를 들면 아래와 같습니다. ​ print(78, BIN) ===> “1001110” print(78, OCT) ===> “116” print(78, DEC) ===> “78” print(78, HEX) ===> “4E” println(1.23456, 0) ===> “1” println(1.23456, 2) ===> “1.23” println(1.23456, 4) ===> “1.2346” ​ -아스키 문자 표시하기- ​ // 아스키 문자 표시하기 display.clearDisplay(); display.setCursor(0,24); display.setTextSize(2); display.write(3); display.display(); delay(2000); print( ) 함수와 println( )​ 함수는 데이터를 사람이 읽을 수 있는 ASCII 문자로 변환해서 디스플레이에 표시하는 반면 write( ) 함수는 넣은 숫자에 해당하는 아스키테이블의 심볼을 표시하게 됩니다. 아래표는 아스키심볼 테이블의 일부입니다. ​ -문자스크롤링하기- ​ ​ // 문자스크롤링하기 display.clearDisplay(); display.setCursor(0,0); display.setTextSize(1); display.println(“Full”); display.println(“screen”); display.println(“scrolling!”); display.display(); display.startscrollright(0x00, 0x07); delay(2000); display.stopscroll(); delay(1000); display.startscrollleft(0x00, 0x07); delay(2000); display.stopscroll(); delay(1000); display.startscrolldiagright(0x00, 0x07); delay(2000); display.startscrolldiagleft(0x00, 0x07); delay(2000); display.stopscroll(); 수평방향의 문자스크롤링은 오른쪽 스크롤링의 경우 startscrollright( ) 함수를 왼쪽 스크롤링은 startcrollleft( ) 함수를 통해 실행할 수 있습니다. 이 함수들에 파라미터로 집어 넣는 2개의 값이 전체 화면 중에서 스크롤을 시킬 범위를 지정하는데 사용됩니다. 위에서 언급한바와 같이 0.96인치 OLED를 기준으로 0에서 7까지의 8개의 페이지로 구분되기 때문에 전체 화면이 스크롤링되게 하려면 파라미터에 0x00과 0x07을 입력하면 됩니다. 위 함수가 실행된 뒤에 스크롤을 머출 때에는 stopscroll( ) 함수를 실행하면 됩니다. ​ -원하는 줄만 스크롤링하기- // 일부분만 스크롤되게 하기 display.setCursor(0,0); display.setTextSize(1); display.println(“Scroll”); display.println(“some part”); display.println(“of the screen.”); display.display(); display.startscrollright(0x00, 0x00); 여러줄로 이루어진 문자열에서 일부분만 스크롤되도록 만들고 싶을때도 있을 거십니다. 이때는 startscrollright( ) 함수와 startscrollleft( ) 함수의 시작페이지와 정지 페이지를 파라미터로 입력할 때 원하는 줄에 해당하도록 입력하면 됩니다. 위에서 0x00은 첫번째 시작페이지를 의미하고 0x00는 정지페이지도 첫번째 줄이기 때문에 첫번째 줄의 문자만 스크롤하게 된 것입니다. 만약 2번째줄과 3번째 줄만 스크롤되게 하고 싶다면 파라미터로 (0x01, 0x02) 를 입력해 주면 됩니다. ​ 【기초 도형 표시하기】 ​ 이번에는 그림을 표시하는 방법에 대해서 예제별로 살펴보도록 하겠습니다. – 사각형 그리기 – display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,0); display.println(“Rectangle”); display.drawRect(0, 15, 60, 40, WHITE); display.display(); delay(2000); display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,0); display.println(“Filled Rectangle”); display.fillRect(0, 15, 60, 40, WHITE); display.display(); delay(2000); 사각형을 그리기 위해서는 drawRect( ) 함수를 사용하면 됩니다. 이 함수는 5개의 파라미터를 넣을 수 있는데요. 사각형을 그리기 시작하는 시작점(왼쪽 위 모서리)의 x좌표, y좌표, 가로길이, 세로길이, 색상 의 5개를 넣으면 됩니다. 이 함수는 기본으로는 1픽셀 만큼의 선 두께를 가진 사각형을 그리게 되는데요. 만약 꽉 채워진 사각형을 그리고자 한다면 fillRect( )함수를 사용하면 됩니다. ​ – 모서리가 둥근 사각형 그리기 – display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,0); display.println(“Round Rectangle”); display.drawRoundRect(0, 15, 60, 40, 8, WHITE); display.display(); delay(2000); display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,0); display.println(“Filled Round Rectangl”); display.fillRoundRect(0, 15, 60, 40, 8, WHITE); display.display(); delay(2000); 모서리가 둥근 사각형을 그리고자 한다면 drawRect( ) 함수 대신에 drawRoundRect( ) 함수를 사용하면 됩니다. 이 함수는 위에서 사용한 drawRect( ) 함수와 동일한 파라미터에 추가적으로 한개의 파라미터를 더 받아 들입니다. 이 파라미터는 코너의 반경입니다. 이 반경값을 조절하면 모서리의 둥근정도를 조절할 수 있습니다. 만약 내부가 채워진 사각형을 그리고자 한다면 fillRoundRect( ) 함수를 사용하면 됩니다. ​ display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,0); display.println(“Triangle”); display.drawTriangle(30, 15, 0, 60, 60, 60, WHITE); display.display(); delay(2000); display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,0); display.println(“Filled Triangle”); display.fillTriangle(30, 15, 0, 60, 60, 60, WHITE); display.display(); delay(2000); 삼각형은 drawTryangle( ) 함수를 통해 그릴수 있습니다. 이 함수는 7개의 파라미터를 받아 들이며 이 중 첫번째부터 6번째까지의 파라미터는 삼각형 세 모서리의 x, y 좌표이고 마지막 7번째 파라미터는 삼각형의 색상을 지정합니다. 이 함수도 기본적으로는 1픽셀의 선 두께를 가진 삼각형을 그리고 내부가 채워진 삼각형을 그릴때는 fillTriangle( ) 함수를 사용하면 됩니다. ​ 【비트맵 이미지 표시하기】 ​ 마지막 예제로서 OLED 디스플레이에 어떻게 비트맵이미지를 표시하는지 확인해 보겠습니다. 이 방법은 회사의 로고나 이미지 그 밖의 재밌는 그래픽이나 정보를 표시할 때 유용한 방법입니다. 일단 아래 코드를 복사해서 아두이노에 업로드 해 보겠습니다. (코드가 길어서 블로그에 넣어지지 않아서 3개로 나눴습니다.) #include #include #include #include #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET 4 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // 마를린 먼로 이미지 const unsigned char MarilynMonroe [] PROGMEM = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x1f, 0xff, 0xff, 0xf0, 0x41, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x7f, 0xff, 0xff, 0xf8, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0xff, 0xff, 0xff, 0xf8, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xfc, 0x02, 0x78, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xfe, 0x03, 0x7c, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x07, 0xff, 0xff, 0xfe, 0x01, 0xfe, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xe0, 0x03, 0xff, 0xff, 0xfc, 0x00, 0xfe, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x87, 0xe0, 0xff, 0xff, 0xfc, 0x00, 0x06, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xf9, 0xff, 0xff, 0xfc, 0x00, 0x02, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xfc, 0x00, 0xc3, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x3f, 0xff, 0xff, 0xe0, 0x0c, 0x00, 0xe7, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xe0, 0x02, 0x00, 0x02, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x1e, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x0f, 0xff, 0x3f, 0xf8, 0x00, 0x18, 0x7f, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0x80, 0x03, 0xfc, 0x3f, 0xfc, 0x00, 0x70, 0xfe, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x43, 0xff, 0xff, 0xf8, 0x7f, 0xf8, 0x00, 0x00, 0x7e, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x07, 0xff, 0xff, 0xf0, 0xff, 0xfc, 0x00, 0x00, 0x7c, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0f, 0xff, 0xff, 0xf1, 0xef, 0xf8, 0x00, 0x01, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe4, 0xff, 0xff, 0xff, 0xf3, 0x80, 0xa0, 0x00, 0x07, 0xfc, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xec, 0x5f, 0xff, 0xff, 0xe7, 0xf0, 0x00, 0x00, 0x03, 0xfe, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x7f, 0xff, 0xff, 0xc7, 0xf8, 0x00, 0x00, 0x03, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xf7, 0xc7, 0xff, 0x06, 0x00, 0x03, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x5f, 0xff, 0xc7, 0x07, 0xff, 0x80, 0x00, 0x07, 0xdb, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0xff, 0xff, 0x80, 0x03, 0xff, 0xc0, 0x00, 0x03, 0xc3, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x98, 0x03, 0xff, 0xf8, 0x00, 0x07, 0xe0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xfc, 0x01, 0x07, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xef, 0xff, 0xff, 0xe1, 0xff, 0xfc, 0x01, 0x07, 0xf8, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0x7f, 0xf1, 0xff, 0xf8, 0x02, 0x07, 0x88, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xef, 0xf8, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x07, 0x84, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xef, 0xf0, 0x04, 0x7f, 0xff, 0xc0, 0x00, 0x07, 0x84, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xe0, 0x00, 0x1f, 0xff, 0x80, 0x00, 0x06, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x7f, 0xe1, 0xf0, 0x07, 0xff, 0x80, 0x00, 0x07, 0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xfe, 0x03, 0xff, 0x00, 0x00, 0x03, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, 0x3f, 0xc6, 0x7f, 0x81, 0xce, 0x00, 0x00, 0x01, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xc0, 0x07, 0xc1, 0xfe, 0x00, 0x00, 0x0d, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xc0, 0x01, 0xe0, 0xfc, 0x00, 0x00, 0x0f, 0xc0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x3f, 0xc0, 0x00, 0x50, 0xfc, 0x00, 0x00, 0x0e, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x3f, 0xc0, 0x00, 0x18, 0xf8, 0x00, 0x00, 0x0e, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x3f, 0xc0, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x66, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x1f, 0xc7, 0x80, 0x00, 0xf8, 0x00, 0x01, 0xe0, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x1f, 0xc1, 0xe0, 0x01, 0xf8, 0x00, 0x03, 0xf0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xc0, 0x3e, 0x03, 0xf0, 0x00, 0x00, 0xe0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1f, 0xe0, 0xe0, 0x03, 0xf2, 0x00, 0x00, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xf0, 0x00, 0x07, 0xe6, 0x00, 0x00, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xff, 0x00, 0x1f, 0xee, 0x00, 0x00, 0x80, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb8, 0x0f, 0xff, 0xf0, 0x3f, 0xdc, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0x0f, 0xff, 0xff, 0xff, 0xdc, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9e, 0x0f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0x0f, 0xff, 0xff, 0xff, 0x70, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0b, 0xff, 0xff, 0xfe, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0b, 0xff, 0xff, 0xf9, 0xc0, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3c, 0x09, 0xff, 0xff, 0xf1, 0x80, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1e, 0x08, 0x3f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x08, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff }; ​ void setup() { // I2C 주소를 0x3C로 초기화 display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // 버퍼를 비우기 display.clearDisplay(); // 비트맵 이미지 표시 display.drawBitmap(0, 0, MarilynMonroe, 128, 64, WHITE); display.display(); } void loop() {} 그럼 아래와 같이 마를린 먼로의 이미지가 출력이 됩니다. 참고로 위에서 PROGMEM이라는 키워드를 사용한 이유는 배열 변수를 램이아닌 플래시메모리에 저장하라는 의미입니다. 이렇게 하는 이유는 아두이노의 램에 변수를 저장하기에는 이미지를 바이트코드로 변환한 배열의 사이즈가 너무 커서 램용량이 부족해 지기 때문입니다.(아두이노 우노버전을 기준으로 플래시메모리는 32KB인 반면 램은 2KB에 불과합니다) ​ 비트맵이미지를 OLED에 표시하기 위해서는 drawBitmap( ) 이라는 함수를 사용하면 되는데요. 이 함수는 6개의 파라미터를 필요로 합니다. 파라미터는 각각 비트맵 이미지의 왼쪽위 모서리의 x좌표, y좌표, 비트맵이미지의 바이트 배열, 비트맵이미지의 가로길이, 비트맵이미지의 세로길이, 색상 입니다. 우리는 128×64픽셀의 이미지를 사용했기 때문에 X, Y 좌표는 0, 0을 너비와 길이에는 128, 64를 각각 입력한 것입니다. ​ 이런 방식으로 drawBitmap( ) 함수를 사용하면 그림을 표현할 수 있다는 것은 알았는데 어떻게 128×64의 사이즈를 가진 이미지를 얻을 수 있는지 궁금하실 텐데요. Inkscape, 포토샵, Paint 등등의 이미지 편집프로그램을 사용해서 사진의 크기를 128×64로 맞춰주면 됩니다. ​ 이미지 크기 변환 이제 128×64 사이지의 이미지를 얻었다면 이를 어떻게 바이트 배열로 변환할 수 있는지 알아야 겠죠? ​ – 온라인 비트맵 배열 생성프로그램(image2cpp) – ​ ​ image2cpp라는 온라인 프로그램을 사용하면 손쉽게 이미지를 바이트 배열로 변환할 수 있습니다. 주소는 여기( http://javl.github.io/image2cpp/ )로 접속하시면 됩니다.. 이 프로그램을 사용하면 우리가 원하는 이미지를 손쉽게 바이트 배열로 바꿀 수 있을 뿐만아니라 이미지 색상반전, 밝기조절, 아두이노 코드로 출력하기 등의 추가 기능도 제공합니다. ​ 예시를 위해 아래와 같은 아두이노 로고 이미지를 한번 디스플레이에 출력해 보도록 하겠습니다. ​ 이미지는 먼저 포토샵이과 같은 이미지 편집프로그램 등을 사용해서 128×64픽셀의 사이즈로 변환시켜 줍니다. 그리고 나서 위에서 말한 image2cpp 웹사이트로 접속합니다. 사이트 접속화면 사이즈에 접속하면 우선 Select image버튼을 클릭해서 변환하고자 하는 이미지 파일을 업로드 합니다. 그다음으로 이미지 세팅에서 사진사이즈는 128×64로 지정해 주고 배경색상을 지정해 줍니다. ​ 3. Preview를 통해 미리보기 기능도 제공이 되는데요. 이상이 없으면 4번에서 Code output format을 Arduino code로 선택하고 generate code 버튼을 눌러줍니다. 그럼 아래에 바이트 배열 코드가 생성이 됩니다. 이제 생성된 배열바이트 코드를 복사해서 아두이노에 마를린 먼로 코드가 있던 곳을 지워고 새로운 코드를 복사해 줍니다. 그리고 drawBitmap의 배열변수도 새로 생성한 배열변수로 수정해 줍니다. 이제 소스코드를 업로드하면 아래 사진처럼 로고가 바뀐 것을 확인 할 수 있습니다. ​ ​ ​ 이제 OLED 모듈 사용 전혀 어렵지 않겠죠?^^ 그럼이만~ ​ 참고자료 및 더 읽어보기 · 참고자료: https://lastminuteengineers.com/oled-display-arduino-tutorial/ ​ 인쇄

Guide for I2C OLED Display with Arduino

This article shows how to use the SSD1306 0.96 inch I2C OLED display with the Arduino. We’ll show you some features of the OLED display, how to connect it to the Arduino board, and how to write text, draw shapes and display bitmap images. Lastly, we’ll build a project example that displays temperature and humidity readings.

Introducing the 0.96 inch OLED display

The organic light-emitting diode (OLED) display that we’ll use in this tutorial is the SSD1306 model: a monocolor, 0.96-inch display with 128×64 pixels as shown in the following figure.

The OLED display doesn’t require backlight, which results in a very nice contrast in dark environments. Additionally, its pixels consume energy only when they are on, so the OLED display consumes less power when compared with other displays.

The model we’re using here has only four pins and communicates with the Arduino using I2C communication protocol. There are models that come with an extra RESET pin. There are also other OLED displays that communicate using SPI communication.

Pin wiring

Because the OLED display uses I2C communication protocol, wiring is very simple. You just need to connect to the Arduino Uno I2C pins as shown in the table below.

Pin Wiring to Arduino Uno Vin 5V GND GND SCL A5 SDA A4

If you’re using a different Arduino board, make sure you check the correct I2C pins:

Nano: SDA (A4); SCL (A5);

MEGA: SDA (20); SCL (21);

Leonardo: SDA (20); SCL (21);

Libraries

To control the OLED display you need the adafruit_SSD1306.h and the adafruit_GFX.h libraries. Follow the next instructions to install those libraries.

1. Open your Arduino IDE and go to Sketch > Include Library > Manage Libraries. The Library Manager should open.

2. Type “SSD1306” in the search box and install the SSD1306 library from Adafruit.

3. After installing the SSD1306 library from Adafruit, type “GFX” in the search box and install the library.

4. After installing the libraries, restart your Arduino IDE.

Tips for writing text using these libraries

Here’s some functions that will help you handle the OLED display library to write text or draw simple graphics.

display.clearDisplay() – all pixels are off

– all pixels are off display.drawPixel(x,y, color) – plot a pixel in the x,y coordinates

– plot a pixel in the x,y coordinates display.setTextSize(n) – set the font size, supports sizes from 1 to 8

– set the font size, supports sizes from 1 to 8 display.setCursor(x,y) – set the coordinates to start writing text

– set the coordinates to start writing text display.print(“message”) – print the characters at location x,y

– print the characters at location x,y display.display() – call this method for the changes to make effect

Testing the OLED Display

After wiring the OLED display to the Arduino and installing all required libraries, you can use one example from the library to see if everything is working properly.

In your Arduino IDE, go to File > Examples > Adafruit SSD1306 and select the example for the display you’re using.

The following code should load:

/********* Complete project details at https://randomnerdtutorials.com 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 128×32 pixel display using I2C to communicate 3 pins are required to interface (two 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, with contributions from the open source community. BSD license, check license.txt for more information All text above, and the splash screen below must be included in any redistribution. *********/ #include #include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); #define NUMFLAKES 10 // Number of snowflakes in the animation example #define LOGO_HEIGHT 16 #define LOGO_WIDTH 16 static const unsigned char PROGMEM logo_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 }; void setup() { Serial.begin(115200); // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(F(“SSD1306 allocation failed”)); for(;;); // Don’t proceed, loop forever } // Show initial display buffer contents on the screen — // the library initializes this with an Adafruit splash screen. display.display(); delay(2000); // Pause for 2 seconds // Clear the buffer display.clearDisplay(); // Draw a single pixel in white display.drawPixel(10, 10, WHITE); // Show the display buffer on the screen. You MUST call display() after // drawing commands to make them visible on screen! display.display(); delay(2000); // display.display() is NOT necessary after every single drawing command, // unless that’s what you want…rather, you can batch up a bunch of // drawing operations and then update the screen all at once by calling // display.display(). These examples demonstrate both approaches… testdrawline(); // Draw many lines testdrawrect(); // Draw rectangles (outlines) testfillrect(); // Draw rectangles (filled) testdrawcircle(); // Draw circles (outlines) testfillcircle(); // Draw circles (filled) testdrawroundrect(); // Draw rounded rectangles (outlines) testfillroundrect(); // Draw rounded rectangles (filled) testdrawtriangle(); // Draw triangles (outlines) testfilltriangle(); // Draw triangles (filled) testdrawchar(); // Draw characters of the default font testdrawstyles(); // Draw ‘stylized’ characters testscrolltext(); // Draw scrolling text testdrawbitmap(); // Draw a small bitmap image // Invert and restore display, pausing in-between display.invertDisplay(true); delay(1000); display.invertDisplay(false); delay(1000); testanimate(logo_bmp, LOGO_WIDTH, LOGO_HEIGHT); // Animate bitmaps } void loop() { } void testdrawline() { int16_t i; display.clearDisplay(); // Clear display buffer for(i=0; i=0; i-=4) { display.drawLine(0, display.height()-1, display.width()-1, i, WHITE); display.display(); delay(1); } delay(250); display.clearDisplay(); for(i=display.width()-1; i>=0; i-=4) { display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE); display.display(); delay(1); } for(i=display.height()-1; i>=0; i-=4) { display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE); display.display(); delay(1); } delay(250); display.clearDisplay(); for(i=0; i0; i-=3) { // The INVERSE color is used so circles alternate white/black display.fillCircle(display.width() / 2, display.height() / 2, i, INVERSE); display.display(); // Update screen with each newly-drawn circle delay(1); } delay(2000); } void testdrawroundrect(void) { display.clearDisplay(); for(int16_t i=0; i0; i-=5) { // The INVERSE color is used so triangles alternate white/black display.fillTriangle( display.width()/2 , display.height()/2-i, display.width()/2-i, display.height()/2+i, display.width()/2+i, display.height()/2+i, INVERSE); display.display(); delay(1); } delay(2000); } void testdrawchar(void) { display.clearDisplay(); display.setTextSize(1); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0, 0); // Start at top-left corner display.cp437(true); // Use full 256 char ‘Code Page 437’ font // Not all the characters will fit on the display. This is normal. // Library will draw what it can and the rest will be clipped. for(int16_t i=0; i<256; i++) { if(i == ' ') display.write(' '); else display.write(i); } display.display(); delay(2000); } void testdrawstyles(void) { display.clearDisplay(); display.setTextSize(1); // Normal 1:1 pixel scale display.setTextColor(WHITE); // Draw white text display.setCursor(0,0); // Start at top-left corner display.println(F("Hello, world!")); display.setTextColor(BLACK, WHITE); // Draw 'inverse' text display.println(3.141592); display.setTextSize(2); // Draw 2X-scale text display.setTextColor(WHITE); display.print(F("0x")); display.println(0xDEADBEEF, HEX); display.display(); delay(2000); } void testscrolltext(void) { display.clearDisplay(); display.setTextSize(2); // Draw 2X-scale text display.setTextColor(WHITE); display.setCursor(10, 0); display.println(F("scroll")); display.display(); // Show initial text delay(100); // Scroll in various directions, pausing in-between: display.startscrollright(0x00, 0x0F); delay(2000); display.stopscroll(); delay(1000); display.startscrollleft(0x00, 0x0F); delay(2000); display.stopscroll(); delay(1000); display.startscrolldiagright(0x00, 0x07); delay(2000); display.startscrolldiagleft(0x00, 0x07); delay(2000); display.stopscroll(); delay(1000); } void testdrawbitmap(void) { display.clearDisplay(); display.drawBitmap( (display.width() - LOGO_WIDTH ) / 2, (display.height() - LOGO_HEIGHT) / 2, logo_bmp, LOGO_WIDTH, LOGO_HEIGHT, 1); display.display(); delay(1000); } #define XPOS 0 // Indexes into the 'icons' array in function below #define YPOS 1 #define DELTAY 2 void testanimate(const uint8_t *bitmap, uint8_t w, uint8_t h) { int8_t f, icons[NUMFLAKES][3]; // Initialize 'snowflake' positions for(f=0; f< NUMFLAKES; f++) { icons[f][XPOS] = random(1 - LOGO_WIDTH, display.width()); icons[f][YPOS] = -LOGO_HEIGHT; icons[f][DELTAY] = random(1, 6); Serial.print(F("x: ")); Serial.print(icons[f][XPOS], DEC); Serial.print(F(" y: ")); Serial.print(icons[f][YPOS], DEC); Serial.print(F(" dy: ")); Serial.println(icons[f][DELTAY], DEC); } for(;;) { // Loop forever... display.clearDisplay(); // Clear the display buffer // Draw each snowflake: for(f=0; f< NUMFLAKES; f++) { display.drawBitmap(icons[f][XPOS], icons[f][YPOS], bitmap, w, h, WHITE); } display.display(); // Show the display buffer on the screen delay(200); // Pause for 1/10 second // Then update coordinates of each flake... for(f=0; f< NUMFLAKES; f++) { icons[f][YPOS] += icons[f][DELTAY]; // If snowflake is off the bottom of the screen... if (icons[f][YPOS] >= display.height()) { // Reinitialize to a random position, just off the top icons[f][XPOS] = random(1 – LOGO_WIDTH, display.width()); icons[f][YPOS] = -LOGO_HEIGHT; icons[f][DELTAY] = random(1, 6); } } } }

View raw code

If your OLED doesn’t have a RESET pin, you should set the OLED_RESET variable to -1 as shown below:

#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)

Upload the code to your Arduino board. Don’t forget to select the right board and COM port in the Tools menu.

You should get a series of different animations in the OLED as shown in the following short video.

If your OLED display is not showing anything:

Check that the OLED display is properly wired to the Arduino

Double-check the OLED display I2C address: with the OLED connected to the Arduino, upload this code and check the I2C address in the Serial Monitor

You should change the OLED address in the following line, if necessary. In our case, the address is 0x3C.

if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {

Write Text – OLED Display

The Adafruit library for the OLED display comes with several functions to write text. In this section, you’ll learn how to write and scroll text using the library functions.

“Hello, world!” OLED Display

The following sketch displays Hello, world! message in the OLED display.

/********* Rui Santos Complete project details at https://randomnerdtutorials.com *********/ #include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Serial.begin(115200); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128×64 Serial.println(F(“SSD1306 allocation failed”)); for(;;); } delay(2000); display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0, 10); // Display static text display.println(“Hello, world!”); display.display(); } void loop() { }

View raw code

After uploading the code, this is what you’ll get in your OLED:

Let’s take a quick look on how the code works.

Importing libraries

First, you need to import the necessary libraries. The Wire library to use I2C and the Adafruit libraries to write to the display: Adafruit_GFX and Adafruit_SSD1306.

#include #include #include

Initialize the OLED display

Then, you define your OLED width and height. In this example, we’re using a 128×64 OLED display. If you’re using other sizes, you can change that in the SCREEN_WIDTH, and SCREEN_HEIGHT variables.

#define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels

Then, initialize a display object with the width and height defined earlier with I2C communication protocol (&Wire).

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

The (-1) parameter means that your OLED display doesn’t have a RESET pin. If your OLED display does have a RESET pin, it should be connected to a GPIO. In that case, you should pass the GPIO number as a parameter.

In the setup(), initialize the Serial Monitor at a baud raute of 115200 for debugging purposes.

Serial.begin(115200);

Initialize the OLED display with the begin() method as follows:

if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(“SSD1306 allocation failed”); for(;;); // Don’t proceed, loop forever }

This snippet also prints a message on the Serial Monitor, in case we’re not able to connect to the display.

Serial.println(“SSD1306 allocation failed”);

In case you’re using a different OLED display, you may need to change the OLED address. In our case, the address is 0x3C.

if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {

If this address doesn’t work, you can run an I2C scanner sketch to find your OLED address. You can find the I2C scanner sketch here.

After initializing the display, add a two second delay, so that the OLED has enough time to initialize before writing text:

delay(2000);

Clear display, set font size, color and write text

After initializing the display, clear the display buffer with the clearDisplay() method:

display.clearDisplay();

Before writing text, you need to set the text size, color and where the text will be displayed in the OLED.

Set the font size using the setTextSize() method:

display.setTextSize(1);

Set the font color with the setTextColor() method:

display.setTextColor(WHITE);

WHITE sets white font and black background.

Define the position where the text starts using the setCursor(x,y) method. In this case, we’re setting the text to start at the (0,10) coordinates.

display.setCursor(0,10);

Finally, you can send the text to the display using the println() method, as follows:

display.println(“Hello, world!”);

Then, you need to call the display() method to actually display the text on the screen.

display.display();

Scrolling Text

The Adafruit OLED library provides useful methods to easily scroll text.

startscrollright(0x00, 0x0F) : scroll text from left to right

startscrollleft(0x00, 0x0F) : scroll text from right to left

startscrolldiagright(0x00, 0x07) : scroll text from left bottom corner to right upper corner

startscrolldiagleft(0x00, 0x07) : scroll text from right bottom corner to left upper corner

The following sketch implements those methods.

/********* Rui Santos Complete project details at https://randomnerdtutorials.com *********/ #include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Serial.begin(115200); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128×64 Serial.println(F(“SSD1306 allocation failed”)); for(;;); } delay(2000); display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0, 0); // Display static text display.println(“Scrolling Hello”); display.display(); delay(100); } void loop() { // Scroll in various directions, pausing in-between: display.startscrollright(0x00, 0x0F); delay(2000); display.stopscroll(); delay(1000); display.startscrollleft(0x00, 0x0F); delay(2000); display.stopscroll(); delay(1000); display.startscrolldiagright(0x00, 0x07); delay(2000); display.startscrolldiagleft(0x00, 0x07); delay(2000); display.stopscroll(); delay(1000); }

View raw code

The text scrolls as shown in the following short video.

Using Other Fonts – OLED Display

The Adafruit GFX library allows us to use some alternate fonts besides the built-in fonts. It allows you to chose between Serif, Sans, and Mono. Each font is available in bold, italic and in different sizes.

The sizes are set by the actual font. So, the setTextSize() method doesn’t work with these fonts. The fonts are available in 9, 12, 18 and 24 point sizes and also contain 7-bit characters (ASCII codes) (described as 7b in the font name).

You can chose from the next selection of fonts:

FreeMono12pt7b.h FreeSansBoldOblique12pt7b.h FreeMono18pt7b.h FreeSansBoldOblique18pt7b.h FreeMono24pt7b.h FreeSansBoldOblique24pt7b.h FreeMono9pt7b.h FreeSansBoldOblique9pt7b.h FreeMonoBold12pt7b.h FreeSansOblique12pt7b.h FreeMonoBold18pt7b.h FreeSansOblique18pt7b.h FreeMonoBold24pt7b.h FreeSansOblique24pt7b.h FreeMonoBold9pt7b.h FreeSansOblique9pt7b.h FreeMonoBoldOblique12pt7b.h FreeSerif12pt7b.h FreeMonoBoldOblique18pt7b.h FreeSerif18pt7b.h FreeMonoBoldOblique24pt7b.h FreeSerif24pt7b.h FreeMonoBoldOblique9pt7b.h FreeSerif9pt7b.h FreeMonoOblique12pt7b.h FreeSerifBold12pt7b.h FreeMonoOblique18pt7b.h FreeSerifBold18pt7b.h FreeMonoOblique24pt7b.h FreeSerifBold24pt7b.h FreeMonoOblique9pt7b.h FreeSerifBold9pt7b.h FreeSans12pt7b.h FreeSerifBoldItalic12pt7b.h FreeSans18pt7b.h FreeSerifBoldItalic18pt7b.h FreeSans24pt7b.h FreeSerifBoldItalic24pt7b.h FreeSans9pt7b.h FreeSerifBoldItalic9pt7b.h FreeSansBold12pt7b.h FreeSerifItalic12pt7b.h FreeSansBold18pt7b.h FreeSerifItalic18pt7b.h FreeSansBold24pt7b.h FreeSerifItalic24pt7b.h FreeSansBold9pt7b.h FreeSerifItalic9pt7b.h

The fonts that work better with the OLED display are the 9 and 12 points size.

To use one of those fonts, first you need to include it in your sketch, for example:

#include

Next, you just need to use the setFont() method and pass as argument, the specified font:

display.setFont(&FreeSerif12pt7b);

After specifying the font, all methods to write text will use that font. To get back to use the original font, you just need to call the setFont() method with no arguments:

display.setFont();

Upload the next sketch to your board:

/********* Rui Santos Complete project details at https://randomnerdtutorials.com *********/ #include #include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Serial.begin(115200); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(“SSD1306 allocation failed”); for(;;); } delay(2000); display.setFont(&FreeSerif9pt7b); display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0,20); display.println(“Hello, world!”); display.display(); delay(2000); } void loop() { }

View raw code

Now, your display prints the “Hello, world!” message in FreeSerif font.

Draw Shapes in the OLED Display

The Adafruit OLED library provides useful methods to draw pixels, lines and shapes. Let’s take a quick look at those methods.

Draw a pixel

To draw a pixel in the OLED display, you can use the drawPixel(x, y, color) method that accepts as arguments the x and y coordinates where the pixel appears, and color. For example:

display.drawPixel(64, 32, WHITE);

Draw a line

Use the drawLine(x1, y1, x2, y2, color) method to create a line. The (x1, y1) coordinates indicate the start of the line, and the (x2, y2) coordinates indicates where the line ends. For example:

display.drawLine(0, 0, 127, 20, WHITE);

Draw a rectangle

The drawRect(x, y, width, height, color) provides an easy way to draw a rectangle. The (x, y) coordinates indicate the top left corner of the rectangle. Then, you need to specify the width, height and color:

display.drawRect(10, 10, 50, 30, WHITE);

You can use the fillRect(x, y, width, height, color) to draw a filled rectangle. This method accepts the same arguments as drawRect().

The library also provides methods to displays rectangles with round corners: drawRoundRect() and fillRoundRect(). These methods accepts the same arguments as previous methods plus the radius of the corner. For example:

display.drawRoundRect(10, 10, 30, 50, 2, WHITE);

Or a filled round rectangle:

display.fillRoundRect(10, 10, 30, 50, 2, WHITE);

Draw a circle

To draw a circle use the drawCircle(x, y, radius, color) method. The (x,y) coordinates indicate the center of the circle. You should also pass the radius as an argument. For example:

display.drawCircle(64, 32, 10, WHITE);

In the same way, to build a filled circle, use the fillCircle() method with the same arguments:

display.fillCircle(64, 32, 10, WHITE);

Draw a triangle

Use the the drawTriangle(x1, y1, x2, y2, x3, y3, color) method to build a triangle. This method accepts as arguments the coordinates of each corner and the color.

display.drawTriangle(10, 10, 55, 20, 5, 40, WHITE);

Use the fillTriangle() method to draw a filled triangle.

display.fillTriangle(10, 10, 55, 20, 5, 40, WHITE);

Invert

The library provides an additional method that you can use with shapes or text: the invertDisplay() method. Pass true as argument to invert the colors of the screen or false to get back to the original colors.

If you call the following command after defining the triangle:

display.invertDisplay(true);

You’ll get an inverted triangle as follows:

Code – Draw Shapes

Upload the following sketch that implements each snippet of code we’ve covered previously and goes through all the shapes.

/********* Rui Santos Complete project details at https://randomnerdtutorials.com *********/ #include #include #include #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { Serial.begin(115200); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(F(“SSD1306 allocation failed”)); for(;;); } delay(2000); // Pause for 2 seconds // Clear the buffer display.clearDisplay(); // Draw a single pixel in white display.drawPixel(64, 32, WHITE); display.display(); delay(3000); // Draw line display.clearDisplay(); display.drawLine(0, 0, 127, 20, WHITE); display.display(); delay(3000); // Draw rectangle display.clearDisplay(); display.drawRect(30, 10, 50, 30, WHITE); display.display(); delay(3000); // Fill rectangle display.fillRect(30, 10, 50, 30, WHITE); display.display(); delay(3000); // Draw round rectangle display.clearDisplay(); display.drawRoundRect(10, 10, 30, 50, 2, WHITE); display.display(); delay(3000); // Fill round rectangle display.clearDisplay(); display.fillRoundRect(10, 10, 30, 50, 2, WHITE); display.display(); delay(3000); // Draw circle display.clearDisplay(); display.drawCircle(64, 32, 10, WHITE); display.display(); delay(3000); // Fill circle display.fillCircle(64, 32, 10, WHITE); display.display(); delay(3000); // Draw triangle display.clearDisplay(); display.drawTriangle(10, 10, 55, 20, 5, 40, WHITE); display.display(); delay(3000); // Fill triangle display.fillTriangle(10, 10, 55, 20, 5, 40, WHITE); display.display(); delay(3000); // Invert and restore display, pausing in-between display.invertDisplay(true); delay(3000); display.invertDisplay(false); delay(3000); } void loop() { }

View raw code

Display Bitmap Images in the OLED

You can display 128×64 bitmap monocolor images on the OLED display.

First, use an imaging program to resize a photo or picture and save it as monochrome bitmap. If you’re on a Windows PC, you can use Paint.

Then, use a Image to C Array converter to convert the image into an array. I’ve used LCD Image Converter.

Run the program and start with a new image. Go to Image > Import and select the bitmap image you’ve created earlier.

Go to Options > Conversion and in the Prepare tab, select the following options:

Type: Monochrome, Threshold Dither

Monochrome, Threshold Dither Main Scan Direction: Top to Bottom

Top to Bottom Line Scan Direction: Forward

Go to the Image tab and select the following options:

Split to rows

Block size: 8 bit

8 bit Byte order: Little-Endian

Then, click OK. Finally, in the main menu, go to File > Convert. A new file with .c extension should be saved. That file contains the C array for the image. Open that file with a text editor, and copy the array.

In our case, this is the array that we get:

static const uint8_t image_data_Saraarray[1024] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x14, 0x9e, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x36, 0x3f, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x6d, 0xff, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0xfb, 0xff, 0x80, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x03, 0xd7, 0xff, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x07, 0xef, 0xff, 0x80, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x0f, 0xdf, 0xff, 0x90, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x0f, 0xbf, 0xff, 0xd0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x1d, 0x7f, 0xff, 0xd0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x01, 0x1b, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x02, 0xa7, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0xff, 0x80, 0x00, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0x07, 0xff, 0xf8, 0xf8, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0e, 0x01, 0xff, 0xc0, 0x38, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1c, 0x46, 0xff, 0xb1, 0x18, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0x97, 0xff, 0xc0, 0x7a, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x01, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x01, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0xbf, 0xff, 0xff, 0xff, 0xfc, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xfd, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0xbf, 0xff, 0xfe, 0xff, 0xfd, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xfb, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x3f, 0xff, 0xdc, 0xff, 0xfa, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x00, 0x0f, 0xf5, 0xff, 0xd7, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x00, 0x0f, 0xfb, 0xff, 0xff, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x0f, 0xfd, 0xff, 0xdf, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x07, 0xff, 0xff, 0xbf, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x07, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x03, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x43, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x01, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xe0, 0x00, 0x00, 0xff, 0xff, 0xff, 0x80, 0x00, 0x7b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xe0, 0x00, 0x00, 0x7f, 0xff, 0xfe, 0x00, 0x00, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x00, 0x27, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x67, 0xff, 0xe0, 0x00, 0x00, 0x1b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x40, 0x00, 0x00, 0xf3, 0xff, 0xc4, 0x00, 0x00, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x80, 0x00, 0x00, 0xfc, 0xff, 0x8c, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0x3c, 0x3c, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x7c, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff };

View raw code

Copy your array to the sketch. Then, to display the array, use the drawBitmap() method that accepts the following arguments (x, y, image array, image width, image height, rotation). The (x, y) coordinates define where the image starts to be displayed.

Copy the code below to display your bitmap image in the OLED.

/********* Rui Santos Complete project details at https://randomnerdtutorials.com *********/ #include #include #include #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); static const unsigned char PROGMEM image_data_Saraarray[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x14, 0x9e, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x36, 0x3f, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x6d, 0xff, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0xfb, 0xff, 0x80, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x03, 0xd7, 0xff, 0x80, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x07, 0xef, 0xff, 0x80, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x0f, 0xdf, 0xff, 0x90, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x0f, 0xbf, 0xff, 0xd0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x1d, 0x7f, 0xff, 0xd0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x01, 0x1b, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x02, 0xa7, 0xff, 0xff, 0xc0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0xff, 0x80, 0x00, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x03, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0xff, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0x07, 0xff, 0xf8, 0xf8, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0e, 0x01, 0xff, 0xc0, 0x38, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1c, 0x46, 0xff, 0xb1, 0x18, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0x97, 0xff, 0xc0, 0x7a, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x01, 0x3f, 0xff, 0xff, 0xff, 0xfe, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x01, 0xbf, 0xff, 0xff, 0xff, 0xfe, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0xbf, 0xff, 0xff, 0xff, 0xfc, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xfd, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0xbf, 0xff, 0xfe, 0xff, 0xfd, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xfb, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x3f, 0xff, 0xdc, 0xff, 0xfa, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd8, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xf8, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x00, 0x0f, 0xf5, 0xff, 0xd7, 0xf8, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa0, 0x00, 0x0f, 0xfb, 0xff, 0xff, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x0f, 0xfd, 0xff, 0xdf, 0xf0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x07, 0xff, 0xff, 0xbf, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x07, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x03, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x43, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x01, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xe0, 0x00, 0x00, 0xff, 0xff, 0xff, 0x80, 0x00, 0x7b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xe0, 0x00, 0x00, 0x7f, 0xff, 0xfe, 0x00, 0x00, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xe0, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x00, 0x27, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x0f, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x67, 0xff, 0xe0, 0x00, 0x00, 0x1b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x40, 0x00, 0x00, 0xf3, 0xff, 0xc4, 0x00, 0x00, 0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x80, 0x00, 0x00, 0xfc, 0xff, 0x8c, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x7f, 0x3c, 0x3c, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0xc0, 0x7c, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff }; void setup() { Serial.begin(115200); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(F(“SSD1306 allocation failed”)); for(;;); } delay(2000); // Pause for 2 seconds // Clear the buffer. display.clearDisplay(); // Draw bitmap on the screen display.drawBitmap(0, 0, image_data_Saraarray, 128, 64, 1); display.display(); } void loop() { }

View raw code

After uploading the code, this is what we get on the display.

Display Temperature and Humidity in the OLED Display with Arduino

In this section we’ll build a project that displays temperature and humidity readings on the OLED display. We’ll get temperature and humidity using the DHT11 temperature and humidity sensor. If you’re not familiar with the DHT11 sensor, read the following article:

Parts required

To complete this project you need the following components:

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Schematic

Assemble the circuit by following the next schematic diagram.

Note: if you’re using a module with a DHT sensor, it normally comes with only three pins. The pins should be labeled so that you know how to wire them. Additionally, many of these modules already come with an internal pull up resistor, so you don’t need to add one to the circuit.

Installing Libraries

Before proceeding, make sure you have installed the“adafruit_GFX.h” and the “adafruit_SSD1306.h” libraries to control the OLED display.

For this project you also need two aditional libraries to read from the DHT sensor: the DHT library and the Adafruit_Sensor library. Follow the next steps to install those libraries

1. Open your Arduino IDE and go to Sketch > Include Library > Manage Libraries. The Library Manager should open.

2. Search for “DHT” on the Search box and install the DHT library from Adafruit.

3. After installing the DHT library from Adafruit, type “Adafruit Unified Sensor” in the search box. Scroll all the way down to find the library and install it.

4. Restart your Arduino IDE.

Code

After installing all the necessary libraries, you can upload the following code.

/********* Rui Santos Complete project details at https://randomnerdtutorials.com *********/ #include #include #include #include #include #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); #define DHTPIN 2 // Digital pin connected to the DHT sensor // Uncomment the type of sensor in use: #define DHTTYPE DHT11 // DHT 11 //#define DHTTYPE DHT22 // DHT 22 (AM2302) //#define DHTTYPE DHT21 // DHT 21 (AM2301) DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(115200); dht.begin(); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(F(“SSD1306 allocation failed”)); for(;;); } delay(2000); display.clearDisplay(); display.setTextColor(WHITE); } void loop() { delay(5000); //read temperature and humidity float t = dht.readTemperature(); float h = dht.readHumidity(); if (isnan(h) || isnan(t)) { Serial.println(“Failed to read from DHT sensor!”); } //clear display display.clearDisplay(); // display temperature display.setTextSize(1); display.setCursor(0,0); display.print(“Temperature: “); display.setTextSize(2); display.setCursor(0,10); display.print(t); display.print(” “); display.setTextSize(1); display.cp437(true); display.write(167); display.setTextSize(2); display.print(“C”); // display humidity display.setTextSize(1); display.setCursor(0, 35); display.print(“Humidity: “); display.setTextSize(2); display.setCursor(0, 45); display.print(h); display.print(” %”); display.display(); }

View raw code

How the Code Works

Read this section if you want to learn how the code works. Otherwise, you can skip to the “Demonstration” section.

Importing libraries

The code starts by including the necessary libraries. The Wire, Adafruit_GFX and Adafruit_SSD1306 are used to interface with the OLED display. The Adafruit_Sensor and the DHT libraries are used to interface with the DHT22 or DHT11 sensors.

#include #include #include #include #include

Create a display object

Then, define your OLED display dimensions. In this case, we’re using a 128×64 pixel display.

#define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels

Then, initialize a display object with the width and height defined earlier with I2C communication protocol (&Wire).

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

The (-1) parameter means that your OLED display doesn’t have a RESET pin. If your OLED display does have a RESET pin, it should be connected to a GPIO. In that case, you should pass the GPIO number as a parameter.

Create a DHT object

Then, define the DHT sensor type you’re using. If you’re using a DHT11 you don’t need to change anything on the code. If you’re using another sensor, just uncomment the sensor you’re using and comment the others.

#define DHTTYPE DHT11 // DHT 11 //#define DHTTYPE DHT22 // DHT 22 (AM2302) //#define DHTTYPE DHT21 // DHT 21 (AM2301)

Initialize a DHT sensor object with the pin and type defined earlier.

DHT dht(DHTPIN, DHTTYPE);

setup()

In the setup(), initialize the serial monitor for debugging purposes.

Serial.begin(115200);

Initialize the DHT sensor:

dht.begin();

Then, initialize the OLED display.

if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128×64 Serial.println(F(“SSD1306 allocation failed”)); for(;;); }

In this case, the address of the OLED display we’re using is 0x3C. If this address doesn’t work, you can run an I2C scanner sketch to find your OLED address. You can find the I2C scanner sketch here.

Add a delay to give time for the display to initialize, clear the display and set the text color to white:

delay(2000); display.clearDisplay(); display.setTextColor(WHITE)

In the loop() is where we read the sensor and display the temperature and humidity on the display.

Get temperature and humidity readings from DHT

The temperature and humidity are saved on the t and h variables, respectively. Reading temperature and humidity is as simple as using the readTemperature() and readHumidity() methods on the dht object.

float t = dht.readTemperature(); float h = dht.readHumidity();

In case we are not able to get the readings, display an error message:

if (isnan(h) || isnan(t)) { Serial.println(“Failed to read from DHT sensor!”); }

If you get that error message, read our troubleshooting guide: how to fix “Failed to read from DHT sensor”.

Display sensor readings on the OLED display

The following lines display the temperature on the OLED display.

display.setTextSize(1); display.setCursor(0,0); display.print(“Temperature: “); display.setTextSize(2); display.setCursor(0,10); display.print(t); display.print(” “); display.setTextSize(1); display.cp437(true); display.write(167); display.setTextSize(2); display.print(“C”);

We use the setTextSize() method to define the font size, the setCursor() sets where the text should start being displayed and the print() method is used to write something on the display.

To print the temperature and humidity you just need to pass their variables to the print() method as follows:

display.print(t);

The “Temperature” label is displayed in size 1, and the actual reading is displayed in size 2.

To display the º symbol, we use the Code Page 437 font. For that, you need to set the cp437 to true as follows:

display.cp437(true);

Then, use the write() method to display your chosen character. The º symbol corresponds to character 167.

display.write(167);

A similar approach is used to display the humidity:

display.setTextSize(1); display.setCursor(0, 35); display.print(“Humidity: “); display.setTextSize(2); display.setCursor(0, 45); display.print(h); display.print(” %”);

Don’t forget that you need to call display.display() at the end, so that you can actually display something on the OLED.

display.display();

Demonstration

After wiring the circuit and uploading the code, the OLED display shows the temperature and humidity readings. The sensor readings are updated every five seconds.

Troubleshooting

If your DHT sensor fails to get the readings or you get the message “Failed to read from DHT sensor”, read our DHT Troubleshooting Guide to help you solve that problem.

If you get the “SSD1306 allocation failed” error or if the OLED is not displaying anything in the screen, it can be one of the following issues:

Wrong I2C address

The I2C address for the OLED display we are using is 0x3C. However, yours may be different. So, make sure you check your display I2C address using an I2C scanner sketch.

SDA and SCL not connected properly

Please make sure that you have the SDA and SCL pins of the OLED display wired correctly.

Wrapping Up

The OLED display provides an easy and inexpensive way to display text or graphics using an Arduino. We hope you’ve found this guide and the project example useful.

If you like Arduino, make sure you check all our Arduino resources:

Don’t miss our next tutorials and projects! Make sure you subscribe the RNT blog.

Thanks for reading

0.96 inch OLED 디스플레이 구동하기

가끔 아두이노로 무엇인가를 만들어 보려고 하다보면 디스플레이가 있으면 하는 생각이 들때가 있습니다. 아두이노는 작은 컴퓨터이기는 하지만 모름지기 컴퓨터라 한다면 입력장치 – 중앙처리장치 – 출력장치가 모두 있어야 비로소 컴퓨터라 할수 있겠지요. 센서나 버튼 등은 간단한 입력장치라 볼수 있겠으나 아두이노 기판에 붙어있는 LED 는 출력장치라고 하기에는 조금 부족한 면이 있습니다.

그래서 오늘은 아두이노 나노 에 OLED 디스플레이를 붙여 볼 생각입니다.

오늘도 역시 알리익스프레스에서 구입한 부품으로 시작합니다.

오늘 필요한 부품은

아두이노 나노 Arduino Nano (우노가 있으신 분은 그냥 우노로 하시면 됩니다)

0.96 inch OLED display (128×64)

이게 전부 입니다.

간단하죠?

참고로 제가 구입한 OLED 보드는 아래의 제품입니다.

Arduino OLED 테스트를 위하여 구입한 제품

I2C 통신이 가능한 모델로 코딩을 간단하게 할수 있고 연결해야 하는 선이 적어 손쉽게 구현이 가능하다는 장점이 있습니다. (4pin)

먼저 OLED 에 무엇인가를 손쉽게 표시하기 위하여는 라이브러리를 받아야 합니다.

아래의 첨부파일을 받아주세요.

Adafruit_SSD1306-master.zip 0.03MB Adafruit-GFX-Library-master.zip 0.32MB

받은신 라이브러리는 압축을 해제하여 내문서> Arduino> Library 폴더안에 아래와 같이 복사해서 넣어주세요.

그럼 기본적인 준비는 끝났습니다.

아두이노 나노와 OLED 를 아래와 같이 연결해 주세요.

A4 –> SDA

A5 –> SCK

5V –> VDD

GND –> GND

요렇게 연결하면 연결도 끝 입니다.

매우 간단하죠?

자 코딩을 해볼까요? 간단하게 텍스트를 출력하는 예제를 짜 보았습니다.

#include #include #include #include #include #include #include #define OLED_ADDR 0x3C // reset pin not used on 4-pin OLED module Adafruit_SSD1306 display(-1); void setup() { // put your setup code here, to run once: display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR); display.setFont(); display.clearDisplay(); display.display(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(2, 25); display.print(“DIY DEV DESIGN”); display.display(); } void loop() { // put your main code here, to run repeatedly: }

setup 에서 한번만 호출해주는 코드 입니다. 나중에 loop 에서 다른 화면을 보여주는 걸로 한다면 인트로 정도가 될 수 있겠습니다.

출력되는 화면을 한번 볼까요?

DIY DEV DESIGN 을 출력해 보았다.

캬~ 아주 깔끔하고 예쁩니다. 디스플레이 크기가 작은 만큼 글자 크기도 좀 작게 설정을 하였는데요. 선명하고 예쁩니다.

우리는 이 디스플레이에 무엇인가를 그리거나 표시하기 위하여 위와 같은 방식으로 계속 직접 코딩을 하는 것은 비 효율 적이기 때문에 뭔가 좀저 효율적으로 그릴 수 있도록 코딩을 해볼 계획입니다.

만들어 볼 기능은 아래와 같습니다. (사실 RC 카 조종기에 넣을 기능임)

텍스트 표시하기

프로그래스 바 표시하기

좌우 밸런스 바 표시하기

텍스트 표시하기

// 위쪽은 동일하므로 생략합니다. void loop() { display.clearDisplay(); draw_text(1, 2, “[ DIY DEV DESIGN ]”, false); draw_text(2, 2, “This is selected menu”, true); draw_text(3, 2, “This is 2nd menu”, false); draw_text(4, 6, “Sub menu 1 line”, false); draw_text(5, 6, “Sub menu 2 line”, false); draw_text(6, 2, “This is 3rd menu”, false); display.display(); delay(1000); } void draw_text (int line, int xPos, String txt, bool isSelected) { int cHeight = (line-1) * 8 + ((line-1) * 2); if(isSelected) { display.fillRect(xPos – 2, cHeight, 127, 8, WHITE); display.setTextColor(BLACK); }else{ display.fillRect(xPos – 2, cHeight, 127, 8, BLACK); display.setTextColor(WHITE); } display.setCursor(xPos, cHeight); display.print(txt); }

아래쪽에 draw_text 라는 함수를 하나 만들어 주었습니다. 원하는 줄에 원하는 텍스트를 쉽게 표시할 수 있도록 했는데요, 특징으로는 메뉴 등의 기능으로 사용할 수 있도록 해당 라인이 선택 상태인지를 입력할 수 있도록 했습니다.

구현된 화면을 보면 아래와 같죠. 로터리 스위치나 푸쉬스위치의 입력을 받아 선택상태를 바꾸어 주는 방식으로 메뉴를 개발할 수 있을 것 같습니다.

아두이노 OLED 텍스트 메뉴 표시 테스트

프로그래스 바 만들어 보기

void loop() { for(int i = 2; i < 127; i++) { display.clearDisplay(); draw_text(1, 2, "[ DIY DEV DESIGN ]", false); draw_text(2, 2, "progress 1", false); draw_progressBox(3, i, false); draw_text(4, 2, "progress 2", false); draw_progressBox(5, 126-i, true); display.display(); delay(20); } } void draw_progressBox(int line, int val, bool isSelected) { int cHeight = (line-1) * 8 + ((line-1) * 2); if(isSelected) { display.fillRect(0, cHeight, 127, 8, WHITE); display.drawRect(1,cHeight+1, 126, 6, BLACK ); display.fillRect(1,cHeight+1, val, 6, BLACK ); }else{ display.drawRect(1,cHeight+1, 126, 6, WHITE ); display.fillRect(1,cHeight+1, val, 6, WHITE ); } } void draw_text (int line, int xPos, String txt, bool isSelected) { //생략 } 이번에는 draw_progressBox 라는 함수로 프로그래스 바를 표현해 봤습니다. 역시 라인의 위치를 간단히 설정할 수 있도록 하였으며 val 값을 입력 받도록 하였습니다. 그리고 텍스트와 마찬가지로 선택상태를 주게 되면 색상이 반전되어 보이도록 기능을 주었습니다. 총 2~126 까지의 값이 표현 가능합니다. 깔끔하게 100개만 입력 받도록 넓이를 조정해보는 것도 좋을 것 같네요. 구현하면 아래와 같이 표시 됩니다. 아두이노, OLED 프로그래스바 코드 테스트 아날로그 발란서 만들어보기 다음은 아날로그 발란서 입니다. 센터를 정해 놓고 좌우로 얼마나 기울었는지 등을 설정하거나 보여주는 기능에 적합한 메뉴 입니다. void loop() { for(int i = 2; i < 127; i++) { display.clearDisplay(); draw_text(1, 2, "[ DIY DEV DESIGN ]", false); draw_text(2, 2, "progress 1", false); draw_analogBalancer (3, i, false); display.display(); delay(20); } } void draw_analogBalancer(int line, int val, bool isSelected) { int cHeight = (line-1) * 8 + ((line - 1) * 2); if (isSelected) { display.fillRect(0, cHeight, 127, 8, WHITE); display.drawLine(0, cHeight+3, 127, cHeight+3, BLACK); display.drawLine(val, cHeight+1, val, cHeight+5, BLACK); display.fillTriangle(64, cHeight+5, 62, cHeight+7, 66, cHeight+7, BLACK); display.drawPixel(val-1, cHeight+3, WHITE); display.drawPixel(val+1, cHeight+3, WHITE); }else{ display.drawLine(0, cHeight+3, 127, cHeight+3, WHITE); display.drawLine(val, cHeight+1, val, cHeight+5, WHITE); display.fillTriangle(64, cHeight+5, 62, cHeight+7, 66, cHeight+7, WHITE); display.drawPixel(val-1, cHeight+3, BLACK); display.drawPixel(val+1, cHeight+3, BLACK); } } 코드가 좀 길죠? 아무래도 표현해야 할 요소가 많기 때문인데요, 역시 선택상태를 표시하기 위하여 두벌로 코딩이 되었습니다. 선택 상태를 만드실 필요가 없다면 else 아래쪽만 코딩을 해주셔도 표현이 가능합니다. 구현된 화면을 한번 보실까요? 아두이노 OLED 밸런스 바 코드 테스트 가운데 세모가 중심의 위치를 나타내고 세로로 얇은 막대가 현재 입력 받는 val 에 해당되는 위치가 됩니다. 물론 반대로 표시하는 것도 조금만 코드를 수정하면 가능하겠죠? 이렇게 하여 간단하게 아두이노를 이용하여 초소형 OLED 를 구동하는 것을 보여드렸습니다. 전혀 어렵지 않으니 바로 도전해 보시기 바랍니다. OLED 가 각종 정보를 표시하는데 생각보다 속도가 많이 느리므로 아두이노 자체 기능이 지연될 수 있습니다. realtime clock 과 같은 실제 시계 등을 만들기 위하여는 위에 표시한 방식과는 다르게 구현을 해야 될 것 같습니다. 궁금하신 것은 뎃글로 문의 해 주시기 바랍니다. 뎃글, 공감 은 블로그 작성자에게 큰 힘이 된답니다. 도움이 되었다 생각되시면 클릭!! 부탁드려요~ 2020/03/23 - [DIY/Arduino] - Arduino(아두이노) 무작정 시작하기 2019/12/23 - [DIY/RC] - 아두이노를 이용한 RC 카 만들기 2 2019/11/10 - [DIY/Arduino] - [DIY] 아두이노로 만능 (통합) 리모콘 만들기 1/3 2019/06/27 - [DIY/Arduino] - 아두이노를 이용한 간단한 화분 자동 물주기 시스템 2019/10/29 - [DIY/Arduino] - [DIY] 아두이노를 이용한 수경재배 시스템

So you have finished reading the 아두 이노 oled topic article, if you find this article useful, please share it. Thank you very much. See more: 아두이노 oled 글자 출력, 아두이노 oled i2c, 아두이노 oled 테트리스, Arduino OLED, 아두이노 oled 오류, 아두이노 디스플레이, I2c oled display, 아두이노 lcd

Leave a Comment