Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
RoboCircuits
Published © CC BY-SA

Arduino Colored OLED

Make your projects colorful.

BeginnerProtip1 hour25,054
Arduino Colored OLED

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Grove - OLED Display 1.12'' V2
Seeed Studio Grove - OLED Display 1.12'' V2
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

schematics

Code

code

C/C++
#define sclk 13
#define mosi 11
#define cs 10
#define rst 9
#define dc 8

// 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

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1331.h>
#include <SPI.h>

Adafruit_SSD1331 display = Adafruit_SSD1331(cs, dc, rst);

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(YouTUBE);

display.fillRect(10,40, 75, 20, RED);

display.setCursor(20,47);
display.setTextColor(WHITE);
display.setTextSize(1);
display.print(Subscribe);

display.drawRect(0,0,96,64,WHITE);
delay(1000);
}

void loop()
{
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(RoboCircuits);
delay(1000);
}

RoboCircuits

C/C++
#define sclk 13
#define mosi 11
#define cs 10
#define rst 9
#define dc 8

// 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

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1331.h>
#include <SPI.h>

Adafruit_SSD1331 display = Adafruit_SSD1331(cs, dc, rst);

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(YouTUBE);

display.fillRect(10,40, 75, 20, RED);

display.setCursor(20,47);
display.setTextColor(WHITE);
display.setTextSize(1);
display.print(Subscribe);

display.drawRect(0,0,96,64,WHITE);
delay(1000);
}

void loop()
{
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(RoboCircuits);
delay(1000);
}

Credits

RoboCircuits
37 projects • 219 followers
YouTuber, Explorer, Creator, Programmer, Arduino Lover and Engineer

Comments