OLED

From MultiWii
Revision as of 06:54, 20 July 2012 by LenzGr (Talk | contribs) (Initial page submission, based on Wayne's posting (http://www.multiwii.com/forum/viewtopic.php?f=7&t=1350&p=19254#p19254))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MultiWii supports a number of LC display, including this OLED from wide.hk:

http://www.wide.hk/products.php?product=I2C-0.96%22-OLED-display-module-%28-compatible-Arduino-%29

http://www.ebay.de/itm/I2C-0-96-OLED-display-module-compatible-Arduino-/130566448551?pt=LH_DefaultDomain_0&hash=item1e665de5a7

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

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

Changes to be made to MW:

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 7 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" // must begin with 0

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…..");