OLED

From MultiWii
Jump to: navigation, search

This page describes the OLED_I2C_128x64. MultiWii supports a number of other displays, listed in Supported_Displays.

This particular OLED is available from the following locations:

The initial discussion thread on the Forum is here: http://www.multiwii.com/forum/viewtopic.php?f=7&t=1350

WarningAn OLED with the same specs is available under the name of crius from rctimer and other sources. Users have reported those having different board layout, probably different firmware and not working reliably as is. A hardware modification is required - two options to try out even. If you still want to go that way, read here http://www.multiwii.com/forum/viewtopic.php?f=6&t=2705&start=20 or simply buy one that is likely to work out of the box from what seems to be the original source (wide.hk) to avoid the hassle.

Connecting it to your MWC is easy via I2C, provide it 5V, GND, SCL & SDL.

Basic code configuration

To enable the OLED, the following changes need to be made to the MultiWii source code:

In config.h:

/**************************************************************/
/*****************        LCD/OLED - display settings       *************/
/*************************************************************/
/* uncomment this line if you plan to use a LCD or OLED */
      #define LCD_CONF

And

/*********************The type of LCD     ***************************/
/* choice of LCD attached for configuration and telemetry, see notes below */
      #define OLED_I2C_128x64 // I2C LCD: OLED http://www.multiwii.com/forum/viewtopic.php?f=7&t=1350

Telemetry can also be turned on:

/************************    Activation     ***************************/
    #define LCD_TELEMETRY

You have to define what telemetry pages to display:

/* to enable automatic hopping between a choice of telemetry pages uncomment this.
       This may be useful if your LCD has no buttons or the sending is broken
       hopping is activated and deactivated in unarmed mode with throttle=low & roll=left & pitch=forward
       set it to the sequence of telemetry pages you want to see
       2 line displays support pages 1-9
       multiline displays support pages 1-5 */
    //#define LCD_TELEMETRY_AUTO "123452679" // pages 1 to 9 in ascending order
    //#define LCD_TELEMETRY_AUTO  "212232425262729" // strong emphasis on page 2
/* same as above, but manual stepping sequence; requires stick input for each stepping */
    //#define LCD_TELEMETRY_STEP "0123456789" // first page gets displayed after initialization

Advanced OLED settings

To edit / change the logo, as a starting point, use the LOGO bitmap in the attached zip file. http://www.multiwii.com/forum/download/file.php?id=978

Simply edit it with any paint program and save the bitmap as 8-bit, monochrome. Then, you need to convert the bitmap to 1024 bytes of pixel data... To do this, you'll need an executable called LCDassistant.exe. get it here: http://www.0x00f.com/files/programs/ Run LCDassistant and load your modified LOGO.bmp Make sure "Byte orientation" is set to Vertical and Pixels/byte is set to 8. Then click Save Output. Name the file logo.h Open this file with a text editor. You should see the array variable definition: const unsigned char LOGO [] = {....... You need all the data between the curly braces, so highlight all the bytes, and copy

Then, in LCD.pde look for

prog_uchar LOGO[] PROGMEM = { // logo....

Replace all 1024 bytes in the LOGO array with the array contents of file you've just saved. ( everything between "{" and "}" ) Do not change anything else.

Adding your name and contact number to OLED display

Look for the following code on the LCD tab:

LCDsetLine(2); LCDprintChar(line2);

I added this directly below that line: (up to 21 characters between “”)

LCDsetLine(3); LCDprintChar("MY NAME, MY NUMBER");

You can even add a forth line:

LCDsetLine(4); LCDprintChar("Bla, Bla, Bla…..");