Skip to content

OLED Wireling Tutorial

TinyCircuits OLED Wireling product photo

The OLED screen wirelings come in three different sizes (0.42", 0.69", and 0.96"), and can all be programmed using the GraphicsBuffer and TinierScreen Library.

0.42" OLED Technical Details

HP7240 Specs

  • 72x40 pixel resolution 
  • 0.42" size 
  • White Monochrome
  • Internal boost converter 
  • I²C Interface 

TinyDuino Power Requirements

  • Voltage: 3.0V - 5.5V 

Pins Used

  • A5/SCL - I2C Serial Clock line
  • A4/SDA - I2C Serial Data line

Dimensions

  • 26mm x 9mm (1.03 inches x 0.355 inches)
  • Max Height (from lower bottom of Wireling to upper top Wireling Connector): 5.00mm (0.197 inches)
  • Weight: 1 gram (.04 ounces)
0.69" OLED Technical Details ER-OLED0.69-1W Specs
  • 96x16 pixel resolution 
  • 0.69" size 
  • White Monochrome
  • Internal boost converter 
  • I²C Interface 
TinyDuino Power Requirements
  • Voltage: 3.0V - 5.5V  ???
  • Current: x.xxmA 
Pins Used
  • A5/SCL - I2C Serial Clock line
  • A4/SDA - I2C Serial Data line
Dimensions
  • 26mm x 9mm (1.03 inches x 0.355 inches)
  • Max Height: 5.00mm (0.197 inches)
  • Weight: 1 gram (.04 ounces)
0.96" OLED Technical Details

ER- OLED0.96-1W Specs

  • 128x64 pixel resolution 
  • 0.96" size (measured diagonally)
  • White Monochrome
  • Internal boost converter 
  • I²C Interface 

TinyDuino Power Requirements

  • Voltage: 3.0V - 5.5V 

Pins Used

  • A5/SCL - I2C Serial Clock line
  • A4/SDA - I2C Serial Data line

Dimensions

  • 27mm x 21mm (1.06 inches x 0.827 inches)
  • Max Height (from lower bottom of Wireling to upper top Wireling Connector): 5.00mm (0.197 inches)
  • Weight: 1 gram (.04 ounces)

Materials

To interface with any TinyCircuits Arduino board, you will need the Arduino IDE and a Micro USB Cable

There are multiple processor/adapter combinations that can be used with Wirelings. Use the following table to find the combination that works for you.

Processor Adapter
* and
*
*
N/A
* N/A
Arduino
Raspberry Pi

* These processors have a 32-pin connector and can have multiple Wireling Adapter TinyShields stacked to increase the number of Wireling ports up to a maximum of 32 total Wireling ports.

In order to interface with Wirelings, you'll need the appropriate number of Wireling Cables and the Wireling.h Library (You can download this from GitHub as linked, or from the Library Manager in the Arduino IDE).

You will also need the OLED Wireling of choice and the Arduino sketch below. The sketch in the following table is initialized to be used with the 0.42" screen, but can easily be changed using some commenting/uncommenting discussed later:

Wireling Code
Port 0
Port 1
Port 2

Hardware Assembly

Depending on the development system you choose, you will need to put together a TinyDuino stack using the 32-pin tan connectors, or you will just need to plug in your Wireling into the ports indicated in the table above, or port 0 with a Wireling Cable. (You can change this port in the included Arduino Sketch using the Wireling.selectPort() function)

NOTE: Be mindful when inserting Wireling Cables - the connector pins inside the 5-pin connectors on Wirelings can be bent when cables are inserted at an angle.

Assembly of Wireling with WirelingZero & connecting cables


Software Setup

You will need to download and install the TinierScreen Library and GraphicsBuffer Library for this example.

To install an Arduino library, check out our Library Installation Page.

Once the Arduino libraries are downloaded, you can open the Arduino sketch included in the table above in the Arduino IDE .

Make the correct Tools selections for your development board. If unsure, you can double check the Help page that mentions the Tools selections needed for any TinyCircuits processor.


Upload Program

Upload the example to your development board of choice!

Example Code
#include <Wire.h>
#include <SPI.h>
#include <Wireling.h>
#include <TinierScreen.h>
#include <GraphicsBuffer.h>

TinierScreen display = TinierScreen(TinierScreen042);
//TinierScreen display = TinierScreen(TinierScreen069);
// TinierScreen display = TinierScreen(TinierScreen096);

GraphicsBuffer screenBuffer = GraphicsBuffer(72, 40, colorDepth1BPP);
//GraphicsBuffer screenBuffer = GraphicsBuffer(96, 16, colorDepth1BPP);
//GraphicsBuffer screenBuffer = GraphicsBuffer(128, 64, colorDepth1BPP);

int displayPort = 0;
int resetPin = A0+displayPort;

void setup() {
  Wire.begin();
  Wireling.begin();

  Wireling.selectPort(displayPort);
  display.begin(resetPin);

  if (screenBuffer.begin()) {
    //memory allocation error- buffer too big!
  }

  screenBuffer.setFont(thinPixel7_10ptFontInfo);
}

int increment = 0;
int xMax, yMax, x, y;
void loop() {
  xMax = screenBuffer.width + 20 - screenBuffer.getPrintWidth("Text Test!");
  yMax = screenBuffer.height + 8 - screenBuffer.getFontHeight();
  x = increment % xMax; if ((increment / xMax) & 1) x = xMax - x;
  y = increment % yMax; if ((increment / yMax) & 1) y = yMax - y;
  x -= 10;
  y -= 4;

  Wireling.selectPort(displayPort);
  screenBuffer.clear();
  screenBuffer.setCursor(x, y);
  screenBuffer.print("Text Test!");
  Wire.setClock(500000);
  display.writeBuffer(screenBuffer.getBuffer(), screenBuffer.getBufferSize());
  Wire.setClock(500000);

  increment++;
  delay(10);
}

If you are not using the 0.42" screen, then you can comment out the display and screenbBuffer variables for the 0.42" screen, and uncomment the variables for the 0.69" screen or 0.96" screen:

TinierScreen display = TinierScreen(TinierScreen042);
//TinierScreen display = TinierScreen(TinierScreen069);
// TinierScreen display = TinierScreen(TinierScreen096);

GraphicsBuffer screenBuffer = GraphicsBuffer(72, 40, colorDepth1BPP);
//GraphicsBuffer screenBuffer = GraphicsBuffer(96, 16, colorDepth1BPP);
//GraphicsBuffer screenBuffer = GraphicsBuffer(128, 64, colorDepth1BPP);

After uploading the program, you should see the screen display "Text Test!". This text then floats around, bouncing off the sides of the screen.


Downloads

0.42" OLED

0.69" OLED

0.96" OLED


Contact Us

If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

Thanks for making with us!