Compile error with serial OLED library

I just bought this off of SparkFun:

I also downloaded the companion library:
http://jennylc.com/4d/

When I tried to compile the example code off of this site, I got this error:

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_ResetDisplay()':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:49: error: 'LOW' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:49: error: 'digitalWrite' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:50: error: 'delay' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:51: error: 'HIGH' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'char OLED_GetResponse()':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:58: error: 'byte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:58: error: expected `;' before 'incomingByte'

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:61: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:61: error: 'delay' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:64: error: 'incomingByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:64: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_Init()':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:75: error: 'delay' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:77: error: 'printByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_Clear()':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:98: error: 'printByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:99: error: 'delay' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_PutPixel(char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:108: error: 'printByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawLine(char, char, char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:124: error: 'printByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawRectangle(char, char, char, char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:145: error: 'printByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawCircle(char, char, char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:165: error: 'printByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_SetFontSize(char)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:188: error: 'printByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawText(char, char, char, char*, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:198: error: 'printByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:203: error: 'strlen' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawSingleChar(char, char, char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:227: error: 'printByte' was not declared in this scope

Here's my code:
files.me.com/elijahwood/hm3zf6 (just type this into a browser any you'll get a zip file with my code. It has 7 tabs, so I can't post it directly.)

I use these libraries in my program:

#include <SoftwareSerial.h>
#include <Servo.h>
#include <x10.h>
#include <x10constants.h>  
#include <TimeAlarms.h>
#include <Time.h>
#include <Ethernet.h>
#include <UdpBytewise.h>
#include <WString.h>

Maybe they're interfering with each other.

Thanks,
Elijah

Heh you posted multiple times...
Anyways you do have the libraries in the right folders? Also you have the newest version?

Yah sorry, my computer is being wierd...

Yep, in the correct spot!

You need to include the oled library: oled160drv.h

replacing printbyte with Serial.print fixes that compile error.

A google search for Arduino printbyte would have nailed that for you.

You may need to add the following includes to the top of the oled library header file:
#include <WProgram.h>
#include <HardwareSerial.h>
#include "string.h"

Yep just tried all that and I get this error:

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_ResetDisplay()':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:49: error: 'LOW' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:49: error: 'digitalWrite' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:50: error: 'delay' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:51: error: 'HIGH' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'char OLED_GetResponse()':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:58: error: 'byte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:58: error: expected `;' before 'incomingByte'

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:61: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:61: error: 'delay' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:64: error: 'incomingByte' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:64: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_Init()':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:75: error: 'delay' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:77: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_Clear()':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:98: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:99: error: 'delay' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_PutPixel(char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:108: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawLine(char, char, char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:124: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawRectangle(char, char, char, char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:145: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawCircle(char, char, char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:165: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_SetFontSize(char)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:188: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawText(char, char, char, char*, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:198: error: 'Serial' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:203: error: 'strlen' was not declared in this scope

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h: In function 'void OLED_DrawSingleChar(char, char, char, char, int)':

/Users/elijahwood/Documents/Arduino/libraries/oled160/oled160drv.h:227: error: 'Serial' was not declared in this scope

I changed all the printBytes in the header file to Serial.prints too.

Any ideas?

did you add the #includes?

Hi myreprapinfo,

The library from 4D OLEDS with Arduino doesn't work right away on today's arduino like you have experienced.
It needs #include <WProgram.h> and replacing printbyte with Serial.print (or Serial.write) like mem mentioned.

There is a library at Google Code Archive - Long-term storage for Google Code Project Hosting. and i made one myself.
If you pm me i can mail you mine if you are interested.
'my' lib has got all (most) functions from the data-sheet including tone generation and sd-card reading/writing.

Jeroen

Hi Jeroen, why not publish your library in the playground?

I'm scared after seeing a page of wiki language. :slight_smile:

Jeroen

If you would like to PM your writup to me, i will create the wiki page for you.

That's great Mem, thanks for the offer!

I will take some time (week or so) to polish/comment code but there's no hurry at all.

You will be hearing from me. :slight_smile:

thanks again,
Jeroen

ps. until then anyone interested can still pm me for a copy of the lib.