Arduino Blog #10 Color OLED display to Arduino
Arduino Microcontroller board
Type B usb cable
PC
Jumper wires
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.
SSD1331 Library: https://github.com/adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino
#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);
}
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);
}
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);
}
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);
}
Hi @lapilipinas! You have received 1.89 SBD @tipU upvote
from @boompanot !
@tipU pays 100% profit + 50% curation rewards to all investors and allows to automatically reinvest selected part of the payout.
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.