I'm trying to display images on an OLED from sparkfun:
using the latest library:Google Code Archive - Long-term storage for Google Code Project Hosting.
I followed a tutorial: 4D OLEDS with Arduino
Instead of using printByte I used uoled.sdWriteByte from the new library without success.
Here is my code:
#include <uOLED.h>
#include <colors.h>
uOLED uoled; // create an instance of the uOLED class with the
void setup() {
Serial.begin(9600);
uoled.begin(8,9600, &Serial);
uoled.SetContrast(5); // set the contrast of the display to 5 (0 to 15 default (not always) is 8)
uoled.DeviceInfo(); // display some hardware/software info of the screen
delay(2000); // info will be on screen for 2 seconds
uoled.Cls(); // clears the screen of everything on it. It uses the background color (at this moment it's at default black)
}
void loop(){
//Display first image
uoled.sdWriteByte(0x40); //extcmd in hex
uoled.sdWriteByte(0x49); //cmd in hex
uoled.sdWriteByte(0); //x
uoled.sdWriteByte(0); //y
uoled.sdWriteByte(128); //width 128
uoled.sdWriteByte(128); //height 128
uoled.sdWriteByte(16); //colour mode 16
//sector address of photo
uoled.sdWriteByte(0); //0
uoled.sdWriteByte(10); //16
uoled.sdWriteByte(0); //0
// uoled.sdDisplayImage(0, 0, 128, 128, 1, 4096L);
//uoled.sdDisplayVideo(0, 0, 160, 128, 1, 0x0, 0x10, 0xFA);
//Serial.print("sdDisplayVideo = ");
//Serial.println(uoled.res, HEX);
//uoled.Cls();
}
I also tried the sdDisplayImage command but that didn't work because I'm not sure how to include the address of the image into the command.
Has anyone else worked with the new library of this OLED? Any help would be appreciated.
p.s. the oled does display with the example codes included in the library.