Arduino Blog #10 Color OLED display to Arduino

in #blog6 years ago (edited)

Hello Dear Makers! This tutorial is an open source arduino project that teaches how to control Color OLED display module to arduino, It has a resolution of 96×64 pixels. So, it has a lower resolution at the same size. We are going to learn how to use this Arduino color OLED display with the SSD1331 driver. It’s very easy, so let’s get started!

20180430_175810_HDR.jpg

Gather all the Requirements

0.95 Colored OLed Display
Arduino Microcontroller board
Type B usb cable
PC
Jumper wires

The display module can display 65 thousand colors it uses the SPI interface so we have to connect 7 pins in order to make it work. So we need more wires in order to connect it with Arduino. GND or the common ground pin goes to Arduino GND. Vcc pin goes to either 3.3V or 5V ( preferred 3.3v) output of the Arduino. The next pin of the display is named SCL which is a mistake. It is actually CLK pin of the SPI interface. So CLK pin goes to digital pin 13 on the Arduino. The next pin SDA but it is actually MOSI pin of the SPI interface. So the 4th pin of the display goes to digital pin 11. The next pin is RES or the reset which goes to digital pin 9. The 6th pin is DC which goes to digital pin 8. The last pin is CS which goes to digital pin 10. That’s it, we have connected the display to the hardware SPI pins of the Arduino Uno r3 board.

20180430_175135_HDR.jpg

Dowload the arduino Desktop IDE: https://www.arduino.cc/en/Main/Software
When the download is finished, un-zip it and open up the Arduino folder to confirm that click yes, there are some files and sub-folders inside. The file structure is important so don’t be moving any files around unless you really know what you’re doing.

We can power and program a SSD1331 library by adafruit Download the library here:
SSD1331 Library: https://github.com/adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino

SOURCE CODE

#include <Adafruit_GFX.h>
#include  <Adafruit_SSD1331.h>
#include <SPI.h>
Adafruit_SSD1331 display = Adafruit_SSD1331(cs, dc, rst);
// Color definitions
#define  BLACK           0x0000
#define BLUE            0x001F
#define RED             0xF800
#define GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0  
#define WHITE           0xFFFF
void setup() {
  display.begin();
  display.fillScreen(RED);
  delay(300);
  display.fillScreen(GREEN);
  delay(300);
  display.fillScreen(BLUE);
  delay(300);
  display.fillScreen(BLACK);
  delay(1000);
  display.setCursor(20,5);
  display.setTextColor(WHITE);
  display.setTextSize(2);
  display.print("Hello");
  display.setCursor(8,25);
  display.setTextColor(RED);
  display.setTextSize(2);
  display.print("SteemiT");
  display.fillRect(10,40, 75, 20, RED);
display.setCursor(20,47);
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.print("lapilipinas");
  display.drawRect(0,0,96,64,WHITE);
  delay(1000);
}

follow.png

void loop() //this runs over and over again
{
  display.fillRect(10,40, 75, 20, BLACK);
  delay(1000);
  display.fillRect(10,40, 75, 20, RED);
  display.setCursor(20,47);
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.print("Follow");
  delay(1000);
}

upvote.png

 display.fillRect(10,40, 75, 20, BLACK);
  delay(1000);
  display.fillRect(10,40, 75, 20, BLUE);
  display.setCursor(20,47);
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.print("UpVote");
  delay(1000);
}

resteem.png

display.fillRect(10,40, 75, 20, BLACK);
  delay(1000);
  display.fillRect(10,40, 75, 20, GREEN);
  display.setCursor(20,47);
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.print("Re-steem");
  delay(1000);
}

I will post a video below. I really like this display, I think it will be my choice for small handheld project. like playing games and displaying texts ans grphical images I would love to hear your opinion about this display. I hope you like this quicky tuts i will give credits to educ8 for their awesomeness Thanks and im sorry for the background sound on video:)!


trgtr

Sort:  
Congratulations This post has been upvoted by SteemMakers. We are a community-based project that aims to support makers and DIYers on the blockchain in every way possible.

Join our Discord Channel to connect with us and nominate your own or somebody else's posts in our review channel.

Help us to reward you for making it ! Join our voting trail or delegate steem power to the community account.

Your post is also presented on the community website www.steemmakers.com where you can find other selected content.

If you like our work, please consider upvoting this comment to support the growth of our community. Thank you.

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.032
BTC 60972.25
ETH 2632.93
USDT 1.00
SBD 2.57