Arduino 0022 and 1.0.1, old is running well, new complie with error

Hi,

I am just doing some studying on LCD12864, and write a simple test program, to show some words a graphics. I can compile it well on version 0022 but it show many errors. I am not very familiar with it, I google and find someone having the same problem, he can solve it by adding #include <arduino.h> into the LCD12864RSPI.h, I tried but no luck.

Errors:
sketch_aug11a.cpp: In function ‘void setup()’:
sketch_aug11a:85: error: ‘class LCD12864RSPI’ has no member named ‘Initialise’
sketch_aug11a.cpp: In function ‘void loop()’:
sketch_aug11a:91: error: ‘class LCD12864RSPI’ has no member named ‘CLEAR’
sketch_aug11a:93: error: ‘class LCD12864RSPI’ has no member named ‘DisplayString’
sketch_aug11a:95: error: ‘class LCD12864RSPI’ has no member named ‘DisplayString’
sketch_aug11a:97: error: ‘class LCD12864RSPI’ has no member named ‘CLEAR’
sketch_aug11a:99: error: ‘class LCD12864RSPI’ has no member named ‘DrawFullScreen’
Bad error line: -1

Here is the code, I just copy some of the major here:

#include “LCD12864RSPI.h”
#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )

void setup()
{
LCDA.Initialise();
delay(100);
}

void loop()
{
LCDA.CLEAR();
delay(100);
LCDA.DisplayString(0,2,show0,AR_SIZE(show0));
delay(100);
LCDA.DisplayString(2,0,show1,AR_SIZE(show1));;
delay(5000);
LCDA.CLEAR();
delay(100);
LCDA.DrawFullScreen(logo0);
delay(5000);
}

Do any of you having the same experience and you can fix it to run on 1.0.1? I won’t want to develop the program on 0022 as I though, I should use something update, but first of all, I need to know how to override the problem.

Thank you very much!
Kent

The only LCD12864RSPI library I could find was this one:

https://bitbucket.org/jasonweiyi/robots/src/5a1943c4eee8/arduino/libraries/LCD12864R/SPI/

The methods it implements use different capitalization:

	void initialise(void);         /* Initialize the screen. */
	void delayns(void);            /* Delay dalayTime amount of microseconds. */
	
	void writeByte(int data);      /* Write byte data. */
	void writeCommand(int cmd);    /* Write command cmd into the screen. */
	void writeData(int data);      /* Write data data into the screen. */
	void moveCursor(int X, int Y); /* Move cursor to 0-based column X and 0-based row Y as the starting point of the next display. */

	void clear(void);			                    /* Clear the screen. */
	void clearRow(int Y);                           /* Clear the y-th row (y is 0-based) */
	void fillBlock(int X, int Y, uchar c, int len); /* Fill block starting from 0-based column X and 0-based row Y with the character c. The filled block is of length len.*/
	void clearBlock(int X, int Y, int length);      /* Clear the block starting from 0-based column X and 0-based row Y. The cleared block is of len byte long. */

	void printf(int X, int Y, char *fmt, ... );         /* Display formated string at 0-based column X and 0-based row Y. The formatted string should not be longer than 64 characters. */
	void displayString(int X,int Y,uchar *ptr,int dat); /* Display string ptr (with length len) at 0-based column X and 0-based row Y. */
	void displaySig(int M,int N,int sig);               /* Display a single character sig at 0-based column X and 0-based row Y. */
	void displayInteger(int X, int Y, int number);      /* Display integer number at 0-based column X and 0-based row Y. */
	
	void drawFullScreen(uchar *p);  /* Display the full screen using data from p. */
	void drawImage1(uchar img[]);   /* Display image */
	void drawImage2(uchar img[]);   /* Display image */

Try that capitalization: 'clear' instead of 'CLEAR' and 'drawFullScreen' instead of 'DrawFullScreen' for example.

John,

Thank you very much!!! I have fix it with modified my program to match with the library. I get the source same to you.
I just start to learning that but I found most code was start with capital, so I modified the .h and .cpp to match with other "sample" out there and so far, it running well.

Not sure why it won't happen on 0022 but on 1.0.1, anyway, thanks so much for your help!

Kent :wink:

The only LCD12864RSPI library I could find was this one:

Bitbucket

The library from that website would not work for me, but I did find success with this one: trackview-arduino/libraries/LCD12864RSPI at master · mikenz/trackview-arduino · GitHub