To use the Upgrade simply attach the Module on top of your WinoBOARD and connect it to a power supply (e.g. by using a Programming board or a USB-Upgrade)
Software / Library:
Please use the latest WinoBOARD integration from the Boardsmanager (at least 1.7.0). This library will include the libraries necessary to use the display.
Basic Examples:
The library is based on the Adafruit SSD1306 Library. To include the library please add this to your first lines of code:
#include "wino_oled.h"
To initialize the display you can simply use:
display.start()
For a complex example which shows the capability of the display please download this Arduino Sketch:
WinoBOARD OLED-Upgrade Example
Basic example to show the MCU temperature on your screen:
#include "wino_oled.h"
void setup(){
display.start(); // Initialize the display
display.invertDisplay(true); //inverts the colors of the display
display.display(); // Show image buffer on the display hardware. The predefined buffer is the WinoBOARD logo.
delay(10000); //wait for 10 seconds
display.invertDisplay(false);
display.clearDisplay(); // Clears the display buffer.
}
void loop(){
display.clearDisplay(); //clears display
display.setTextSize(1); //set to small text size for upper line
display.setTextColor(WHITE);
display.println(""); //write empty line
display.setCursor(5,5);
display.println("current temperature:"); //draws line
display.setTextSize(3); //set to bigger text
display.setCursor(5,28);
float temperatur = float(getTemp())/10; //reads MCU temperature
display.println(String(temperatur) + "C"); //write temperature in °C
display.display(); //displays text
delay(1000); // delay for next refresh
}
Show a custom picture on the screen:
There is an easy way to show custom pictures on the screen. You can use our Picture to Array converter to create a picture array and show it by using the writebuffer function:
#include "wino_oled.h"
uint8_t picture[64 * 128 / 8] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 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 0x80, 0x80, 0x00, 0x00, 0x00, 0x01,
0x01, 0x01, 0x03, 0x07, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xF8, 0xE0, 0x80, 0x00, 0x01, 0x07, 0x1F, 0x7F, 0xFC, 0xF8, 0xE0,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xC0, 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x80,
0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0,
0xC0, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x60, 0x20, 0x20, 0x20, 0x20, 0x30, 0x70, 0x20, 0x00, 0x00,
0x30, 0xF8, 0xF8, 0x8C, 0x04, 0x04, 0x04, 0x04, 0x0C, 0x0C, 0xC0, 0xC0, 0xC3, 0x0F, 0x3F, 0xF9,
0xE9, 0x49, 0x48, 0x44, 0x44, 0x64, 0x20, 0x21, 0x03, 0x13, 0x12, 0x32, 0x22, 0x22, 0x22, 0x22,
0x22, 0x14, 0x1C, 0x1C, 0x18, 0x03, 0x03, 0x12, 0x14, 0x24, 0x24, 0x24, 0x25, 0x21, 0x0B, 0x4A,
0x70, 0x70, 0x60, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF0, 0xC0, 0x00, 0x00, 0x03, 0x0F,
0x3F, 0xFE, 0xF8, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0D, 0x0A, 0x12, 0x12, 0x12, 0x12,
0x04, 0x25, 0x25, 0x3C, 0x38, 0x10, 0x03, 0x0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FF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
void setup(){
display.start(); // Initialize the display
display.writebuffer(picture);
display.display(); // Show image buffer on the display hardware. The predefined buffer is the WinoBOARD logo.
}
void loop(){
}
For further information please also have a look at the Adafruit website:
Adafruit OLED library and examples