chipKIT® Development Platform

Inspired by Arduino™

Creating and loading a bitmap in the IOShieldOled demo

Created Mon, 16 Apr 2012 08:45:49 +0000 by dcje01


dcje01

Mon, 16 Apr 2012 08:45:49 +0000

Hi,

I was just wondering if anyone has had any experience with this? I am essentially trying to load a bitmap and display it on the OLED on the basic IO shield.

I have created a simple 8 x 8 pixel bitmap file with all the pixels on, which looks something like this:

#include <p32xxxx.h>
#include <plib.h>

/* ------------------------------------------------------------ */
/*				Global Variables								*/
/* ------------------------------------------------------------ */

const BYTE rgbOledBmp[] = {
	
	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,	// 0x01

};

/* ------------------------------------------------------------ */

/************************************************************************/

I have called this file BMP.c and put it in the same directory as IOShieldOled.c and IOShieldOled.h

In my OLED_Demo sketch I am trying to use the line:

IOShieldOled.putBmp(IOShieldOled.getBmp(8, 8, pbBmp));

But not being a full time programmer (and being a hardware engineer) I am not sure how to include and point to the bitmap location. I have included a

#include <BMP.c>

line at the start of the sketch and also require some kind of definition of "pbBmp" that points to the rgbOledBmp[] array in BMP.c.

Any ideas on this will be massively appreciated.

Thanks, David


dcje01

Mon, 23 Apr 2012 09:12:58 +0000

I have found the example "OLED_full_demo" in the OLED example download from the IOShield zip file found on the IO shield product page which seems to answer my question. Both OLED demo sketches found in this zip file have good comprehensive demo's of display functionality - it is within this download that the "IOShieldOled.h" and "IOShieldOled.cpp" can be found where the necessary function declarations can be found.

On another note, the demo "OLEDDemo" found in the "OLED" zip file on the Un032 product page doesn't seem to work; I believe it has something to do with the "OledClass OLED;" line in the sketch; perhaps this is not defining the class properly, so it will compile but will not do anything? Everything looks to be OK in the code & related files. I'm not massively knowledgeable regarding cpp programming.


Ryan K

Fri, 27 Apr 2012 00:01:09 +0000

Hello,

The OLED zip file on the Uno32 page should work it is just targeted for the PmodOLED and not the OLED on the IOShield. That's the reason why it doesn't seem to work I believe the reset, D/C, Vbat, and VDD control lines are on different pins for the two devices.

Best Regards, Ryan K Digilent