3 Wire serial LCD Module compiling problem.

Hello, new here. Just bought a 3 wire LCD module an get this message compiling the example of the wiki page. I got the new libraries supporting Arduino IDE 1.0 + from another post, and tried with IDE 1.0.1 and 1.0.4
libraries from this post:
[url=http://www.dfrobot.com/forum/index.php?topic=573.msg2668#msg2668]http://www.dfrobot.com/forum/index.php?topic=573.msg2668#msg2668[/url]
Error message:
[b]sketch_mar20a.ino: In function 'void setup()':
sketch_mar20a:27: error: 'class LCD12864RSPI' has no member named 'initDriverPin'[/b]
code used:
[code]/*
LCD Arduino
PIN1 = GND
PIN2 = 5V
RS(CS) = 8;
RW(SID)= 9;
EN(CLK) = 3;
PIN15 PSB = GND;
*/
#include "LCD12864RSPI.h"
#include "DFrobot_bmp.h"
#include "DFrobot_char.h"
#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )
unsigned char wangzhi[]=" [url=http://www.DFRobot.com]www.DFRobot.com[/url] ";//
unsigned char en_char1[]="ST7920 LCD12864 ";//
unsigned char en_char2[]="Test, Copyright ";//
unsigned char en_char3[]="by DFRobot ---> ";//
void setup()
{
LCDA.initDriverPin(2,7,10); //INIT SPI Interface
LCDA.Initialise(); // INIT SCREEN
delay(100);
LCDA.DrawFullScreen(logo);//LOGO
delay(5000);
}
void loop()
{
LCDA.CLEAR();//Clear Screen
delay(100);
LCDA.DisplayString(0,0,en_char1,16);//
delay(10);
LCDA.DisplayString(1,0,en_char2,16);//
delay(10);
LCDA.DisplayString(2,0,en_char3,16);//
delay(10);
LCDA.DisplayString(3,0,wangzhi,16);//
delay(5000);
LCDA.CLEAR();//Clear Screen
delay(100);
LCDA.DisplayString(0,0,show1,16);//
delay(10);
LCDA.DisplayString(1,0,show2,16);//
delay(10);
LCDA.DisplayString(2,0,show3,16);//
delay(10);
LCDA.DisplayString(3,0,wangzhi,16);//LOGO
delay(5000);
}[/code]
Any help please?
libraries from this post:
[url=http://www.dfrobot.com/forum/index.php?topic=573.msg2668#msg2668]http://www.dfrobot.com/forum/index.php?topic=573.msg2668#msg2668[/url]
Error message:
[b]sketch_mar20a.ino: In function 'void setup()':
sketch_mar20a:27: error: 'class LCD12864RSPI' has no member named 'initDriverPin'[/b]
code used:
[code]/*
LCD Arduino
PIN1 = GND
PIN2 = 5V
RS(CS) = 8;
RW(SID)= 9;
EN(CLK) = 3;
PIN15 PSB = GND;
*/
#include "LCD12864RSPI.h"
#include "DFrobot_bmp.h"
#include "DFrobot_char.h"
#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )
unsigned char wangzhi[]=" [url=http://www.DFRobot.com]www.DFRobot.com[/url] ";//
unsigned char en_char1[]="ST7920 LCD12864 ";//
unsigned char en_char2[]="Test, Copyright ";//
unsigned char en_char3[]="by DFRobot ---> ";//
void setup()
{
LCDA.initDriverPin(2,7,10); //INIT SPI Interface
LCDA.Initialise(); // INIT SCREEN
delay(100);
LCDA.DrawFullScreen(logo);//LOGO
delay(5000);
}
void loop()
{
LCDA.CLEAR();//Clear Screen
delay(100);
LCDA.DisplayString(0,0,en_char1,16);//
delay(10);
LCDA.DisplayString(1,0,en_char2,16);//
delay(10);
LCDA.DisplayString(2,0,en_char3,16);//
delay(10);
LCDA.DisplayString(3,0,wangzhi,16);//
delay(5000);
LCDA.CLEAR();//Clear Screen
delay(100);
LCDA.DisplayString(0,0,show1,16);//
delay(10);
LCDA.DisplayString(1,0,show2,16);//
delay(10);
LCDA.DisplayString(2,0,show3,16);//
delay(10);
LCDA.DisplayString(3,0,wangzhi,16);//LOGO
delay(5000);
}[/code]
Any help please?
2017-02-03 23:54:49 Hi Sir,
Sorry for the late reply, since the Spring Festival.
Please make sure the steps are correct, then try to download the IDE of 1.0.* to try again. The library should support Arduino IDE 1.0 and up. Probably there is a problem with the compatibility.
Let me know if you have any problem.
Wendy.Hu
Sorry for the late reply, since the Spring Festival.
Please make sure the steps are correct, then try to download the IDE of 1.0.* to try again. The library should support Arduino IDE 1.0 and up. Probably there is a problem with the compatibility.
Let me know if you have any problem.

2017-01-26 07:48:19 I am also having difficulties.
I am running Arduino IDE 1.8.2, and using an Uno.
I have downloaded the v1.0 of the SPI library, and have opened the sketch from with in the IDE, as well as tried copying and pasting the sketch from the web page.
Still isn't working.
Here is the sketch:
***
/*
LCD Arduino
PIN1 = GND
PIN2 = 5V
RS(CS) = 8;
RW(SID)= 9;
EN(CLK) = 3;
PIN15 PSB = GND;
*/
#include "LCD12864RSPI.h"
#include "examples/LCD12864_test/DFrobot_bmp.h"
#include "examples/LCD12864_test/DFrobot_char.h"
#include "stdlib.h"
#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )
unsigned char wangzhi[]="make_clickable_callback(MAGIC_URL_WWW, ' ', 'www.DFRobot.cn', '', ' class="postlink"') ";//
unsigned char en_char1[]="ST7920 LCD12864 ";//
unsigned char en_char2[]="Test, Copyright ";//
unsigned char en_char3[]="by DFRobot ---> ";//
void setup()
{
LCDA.Initialise(); // INIT SCREEN
delay(100);
LCDA.DrawFullScreen(logo);//LOGO
delay(5000);
}
void loop()
{
LCDA.CLEAR();//����
delay(100);
LCDA.DisplayString(0,0,en_char1,16);//
delay(10);
LCDA.DisplayString(1,0,en_char2,16);//
delay(10);
LCDA.DisplayString(2,0,en_char3,16);//
delay(10);
LCDA.DisplayString(3,0,wangzhi,16);//
delay(5000);
LCDA.CLEAR();//����
delay(100);
LCDA.DisplayString(0,0,show1,16);//
delay(10);
LCDA.DisplayString(1,0,show2,16);//
delay(10);
LCDA.DisplayString(2,0,show3,16);//
delay(10);
LCDA.DisplayString(3,0,wangzhi,16);//LOGO
delay(5000);
}
***
And here are the current error messages:
***
Arduino: 1.8.2 (Linux), Board: "Arduino/Genuino Uno"
In file included from /home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:10:0:
/home/jack/Arduino/libraries/LCD12864RSPI/wiring.h: In function 'void delayMicroseconds(uint32_t)':
/home/jack/Arduino/libraries/LCD12864RSPI/wiring.h:71:26: error: 'VARIANT_MCK' was not declared in this scope
uint32_t n = usec * (VARIANT_MCK / 3000000);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp: In member function 'void LCD12864RSPI::WriteByte(int)':
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:34:28: error: 'HIGH' was not declared in this scope
digitalWrite(latchPin, HIGH);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:34:32: error: 'digitalWrite' was not declared in this scope
digitalWrite(latchPin, HIGH);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:36:33: error: 'MSBFIRST' was not declared in this scope
shiftOut(dataPin, clockPin, MSBFIRST, dat);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:36:46: error: 'shiftOut' was not declared in this scope
shiftOut(dataPin, clockPin, MSBFIRST, dat);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:37:28: error: 'LOW' was not declared in this scope
digitalWrite(latchPin, LOW);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp: In member function 'void LCD12864RSPI::Initialise()':
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:72:23: error: 'OUTPUT' was not declared in this scope
pinMode(latchPin, OUTPUT);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:72:29: error: 'pinMode' was not declared in this scope
pinMode(latchPin, OUTPUT);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:75:28: error: 'LOW' was not declared in this scope
digitalWrite(latchPin, LOW);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:75:31: error: 'digitalWrite' was not declared in this scope
digitalWrite(latchPin, LOW);
^
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
***
Also, here is the .h library
***
//Demo LCD12864 spi
//www.dfrobot.com
#ifndef LCD12864RSPI_h
#define LCD12864RSPI_h
#include <avr/pgmspace.h>
#include <inttypes.h>
class LCD12864RSPI {
typedef unsigned char uchar;
public:
LCD12864RSPI();
void Initialise(void);
void delayns(void);
void WriteByte(int dat);
void WriteCommand(int CMD);
void WriteData(int CMD);
void CLEAR(void);
void DisplayString(int X,int Y,uchar *ptr,int dat);
void DisplaySig(int M,int N,int sig);
void DrawFullScreen(uchar *p);
void img1(uchar img[]);
void img2(uchar img[]);
int delaytime;
int DEFAULTTIME;
static const int latchPin = 8;
static const int clockPin = 3;
static const int dataPin = 9;
};
extern LCD12864RSPI LCDA;
#endif
***
And here is the .cpp :
***
//Demo LCD12864 spi
//www.dfrobot.com
#include "LCD12864RSPI.h"
extern "C"
{
#include <wiring.h>
#include <inttypes.h>
#include <stdio.h> //not needed yet
#include <string.h> //needed for strlen()
#include <avr/pgmspace.h>
}
LCD12864RSPI::LCD12864RSPI()
{
this->DEFAULTTIME = 80; // 80 ms default time
this->delaytime = DEFAULTTIME;
}
//*********************ÑÓʱº¯Êý************************//
void LCD12864RSPI::delayns(void)
{
delayMicroseconds(delaytime);
}
void LCD12864RSPI::WriteByte(int dat)
{
digitalWrite(latchPin, HIGH);
delayns();
shiftOut(dataPin, clockPin, MSBFIRST, dat);
digitalWrite(latchPin, LOW);
}
void LCD12864RSPI::WriteCommand(int CMD)
{
int H_data,L_data;
H_data = CMD;
H_data &= 0xf0; //ÆÁ±ÎµÍ4λµÄÊýŸÝ
L_data = CMD; //xxxx0000žñÊœ
L_data &= 0x0f; //ÆÁ±Îžß4λµÄÊýŸÝ
L_data <<= 4; //xxxx0000žñÊœ
WriteByte(0xf8); //RS=0£¬ÐŽÈëµÄÊÇÖžÁ
WriteByte(H_data);
WriteByte(L_data);
}
void LCD12864RSPI::WriteData(int CMD)
{
int H_data,L_data;
H_data = CMD;
H_data &= 0xf0; //ÆÁ±ÎµÍ4λµÄÊýŸÝ
L_data = CMD; //xxxx0000žñÊœ
L_data &= 0x0f; //ÆÁ±Îžß4λµÄÊýŸÝ
L_data <<= 4; //xxxx0000žñÊœ
WriteByte(0xfa); //RS=1£¬ÐŽÈëµÄÊÇÊýŸÝ
WriteByte(H_data);
WriteByte(L_data);
}
void LCD12864RSPI::Initialise()
{
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
digitalWrite(latchPin, LOW);
delayns();
WriteCommand(0x30); //¹ŠÄÜÉè¶š¿ØÖÆ×Ö
WriteCommand(0x0c); //ÏÔÊŸ¿ª¹Ø¿ØÖÆ×Ö
WriteCommand(0x01); //Çå³ýÆÁÄ»¿ØÖÆ×Ö
WriteCommand(0x06); //œøÈëÉè¶šµã¿ØÖÆ×Ö
}
void LCD12864RSPI::CLEAR(void)
{
WriteCommand(0x30);//
WriteCommand(0x01);//Çå³ýÏÔÊŸ
}
void LCD12864RSPI::DisplayString(int X,int Y,uchar *ptr,int dat)
{
int i;
switch(X)
{
case 0: Y|=0x80;break;
case 1: Y|=0x90;break;
case 2: Y|=0x88;break;
case 3: Y|=0x98;break;
default: break;
}
WriteCommand(Y); // ¶šÎ»ÏÔÊŸÆðÊŒµØÖ·
for(i=0;i<dat;i++)
{
WriteData(ptr[i]);//ÏÔÊŸºº×ÖʱעÒâÂëÖµ£¬Á¬ÐøÁœžöÂë±íÊŸÒ»žöºº×Ö
}
}
void LCD12864RSPI::DisplaySig(int M,int N,int sig)
{
switch(M)
{
case 0: N|=0x80;break;
case 1: N|=0x90;break;
case 2: N|=0x88;break;
case 3: N|=0x98;break;
default: break;
}
WriteCommand(N); // ¶šÎ»ÏÔÊŸÆðÊŒµØÖ·
WriteData(sig); //Êä³öµ¥žö×Ö·û
}
void LCD12864RSPI::DrawFullScreen(uchar *p)
{
int ygroup,x,y,i;
int temp;
int tmp;
for(ygroup=0;ygroup<64;ygroup++) //ÐŽÈëÒºŸ§ÉϰëÍŒÏ󲿷Ö
{ //ÐŽÈë×ø±ê
if(ygroup<32)
{
x=0x80;
y=ygroup+0x80;
}
else
{
x=0x88;
y=ygroup-32+0x80;
}
WriteCommand(0x34); //ÐŽÈëÀ©³äÖžÁîÃüÁî
WriteCommand(y); //ÐŽÈëyÖá×ø±ê
WriteCommand(x); //ÐŽÈëxÖá×ø±ê
WriteCommand(0x30); //ÐŽÈë»ù±ŸÖžÁîÃüÁî
tmp=ygroup*16;
for(i=0;i<16;i++)
{
temp=p[tmp++];
WriteData(temp);
}
}
WriteCommand(0x34); //ÐŽÈëÀ©³äÖžÁîÃüÁî
WriteCommand(0x36); //ÏÔÊŸÍŒÏó
}
void LCD12864RSPI::img1(uchar img[])
{
unsigned int i;
unsigned char page,column;
for(page=0xB0;page<0xB4;page++)
{
WriteCommand(page); //set page address
WriteCommand(0x10); //set Column address MSB
WriteCommand(0x04); //set column address LSB
i = (0xB3-page)*128;
for(column=0;column<128;column++)
{
WriteData(~img[i+column]);
}
}
WriteCommand(0x34); //ÐŽÈëÀ©³äÖžÁîÃüÁî
WriteCommand(0x36); //ÏÔÊŸÍŒÏó
}
void LCD12864RSPI::img2(uchar img[])
{
unsigned int i;
unsigned char page,column;
for(page=0xB4;page<0xB8;page++)
{
WriteCommand(page); //set page address
WriteCommand(0x10); //set Column address MSB
WriteCommand(0x04); //set column address LSB
i = (0xB7-page)*128;
for(column=0;column<128;column++)
{
WriteData(~img[i+column]);
}
}
WriteCommand(0x34); //ÐŽÈëÀ©³äÖžÁîÃüÁî
WriteCommand(0x36); //ÏÔÊŸÍŒÏó
}
LCD12864RSPI LCDA = LCD12864RSPI();
***
Thanks for your assistance!
jwh7
I am running Arduino IDE 1.8.2, and using an Uno.
I have downloaded the v1.0 of the SPI library, and have opened the sketch from with in the IDE, as well as tried copying and pasting the sketch from the web page.
Still isn't working.
Here is the sketch:
***
/*
LCD Arduino
PIN1 = GND
PIN2 = 5V
RS(CS) = 8;
RW(SID)= 9;
EN(CLK) = 3;
PIN15 PSB = GND;
*/
#include "LCD12864RSPI.h"
#include "examples/LCD12864_test/DFrobot_bmp.h"
#include "examples/LCD12864_test/DFrobot_char.h"
#include "stdlib.h"
#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )
unsigned char wangzhi[]="make_clickable_callback(MAGIC_URL_WWW, ' ', 'www.DFRobot.cn', '', ' class="postlink"') ";//
unsigned char en_char1[]="ST7920 LCD12864 ";//
unsigned char en_char2[]="Test, Copyright ";//
unsigned char en_char3[]="by DFRobot ---> ";//
void setup()
{
LCDA.Initialise(); // INIT SCREEN
delay(100);
LCDA.DrawFullScreen(logo);//LOGO
delay(5000);
}
void loop()
{
LCDA.CLEAR();//����
delay(100);
LCDA.DisplayString(0,0,en_char1,16);//
delay(10);
LCDA.DisplayString(1,0,en_char2,16);//
delay(10);
LCDA.DisplayString(2,0,en_char3,16);//
delay(10);
LCDA.DisplayString(3,0,wangzhi,16);//
delay(5000);
LCDA.CLEAR();//����
delay(100);
LCDA.DisplayString(0,0,show1,16);//
delay(10);
LCDA.DisplayString(1,0,show2,16);//
delay(10);
LCDA.DisplayString(2,0,show3,16);//
delay(10);
LCDA.DisplayString(3,0,wangzhi,16);//LOGO
delay(5000);
}
***
And here are the current error messages:
***
Arduino: 1.8.2 (Linux), Board: "Arduino/Genuino Uno"
In file included from /home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:10:0:
/home/jack/Arduino/libraries/LCD12864RSPI/wiring.h: In function 'void delayMicroseconds(uint32_t)':
/home/jack/Arduino/libraries/LCD12864RSPI/wiring.h:71:26: error: 'VARIANT_MCK' was not declared in this scope
uint32_t n = usec * (VARIANT_MCK / 3000000);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp: In member function 'void LCD12864RSPI::WriteByte(int)':
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:34:28: error: 'HIGH' was not declared in this scope
digitalWrite(latchPin, HIGH);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:34:32: error: 'digitalWrite' was not declared in this scope
digitalWrite(latchPin, HIGH);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:36:33: error: 'MSBFIRST' was not declared in this scope
shiftOut(dataPin, clockPin, MSBFIRST, dat);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:36:46: error: 'shiftOut' was not declared in this scope
shiftOut(dataPin, clockPin, MSBFIRST, dat);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:37:28: error: 'LOW' was not declared in this scope
digitalWrite(latchPin, LOW);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp: In member function 'void LCD12864RSPI::Initialise()':
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:72:23: error: 'OUTPUT' was not declared in this scope
pinMode(latchPin, OUTPUT);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:72:29: error: 'pinMode' was not declared in this scope
pinMode(latchPin, OUTPUT);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:75:28: error: 'LOW' was not declared in this scope
digitalWrite(latchPin, LOW);
^
/home/jack/Arduino/libraries/LCD12864RSPI/LCD12864RSPI.cpp:75:31: error: 'digitalWrite' was not declared in this scope
digitalWrite(latchPin, LOW);
^
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
***
Also, here is the .h library
***
//Demo LCD12864 spi
//www.dfrobot.com
#ifndef LCD12864RSPI_h
#define LCD12864RSPI_h
#include <avr/pgmspace.h>
#include <inttypes.h>
class LCD12864RSPI {
typedef unsigned char uchar;
public:
LCD12864RSPI();
void Initialise(void);
void delayns(void);
void WriteByte(int dat);
void WriteCommand(int CMD);
void WriteData(int CMD);
void CLEAR(void);
void DisplayString(int X,int Y,uchar *ptr,int dat);
void DisplaySig(int M,int N,int sig);
void DrawFullScreen(uchar *p);
void img1(uchar img[]);
void img2(uchar img[]);
int delaytime;
int DEFAULTTIME;
static const int latchPin = 8;
static const int clockPin = 3;
static const int dataPin = 9;
};
extern LCD12864RSPI LCDA;
#endif
***
And here is the .cpp :
***
//Demo LCD12864 spi
//www.dfrobot.com
#include "LCD12864RSPI.h"
extern "C"
{
#include <wiring.h>
#include <inttypes.h>
#include <stdio.h> //not needed yet
#include <string.h> //needed for strlen()
#include <avr/pgmspace.h>
}
LCD12864RSPI::LCD12864RSPI()
{
this->DEFAULTTIME = 80; // 80 ms default time
this->delaytime = DEFAULTTIME;
}
//*********************ÑÓʱº¯Êý************************//
void LCD12864RSPI::delayns(void)
{
delayMicroseconds(delaytime);
}
void LCD12864RSPI::WriteByte(int dat)
{
digitalWrite(latchPin, HIGH);
delayns();
shiftOut(dataPin, clockPin, MSBFIRST, dat);
digitalWrite(latchPin, LOW);
}
void LCD12864RSPI::WriteCommand(int CMD)
{
int H_data,L_data;
H_data = CMD;
H_data &= 0xf0; //ÆÁ±ÎµÍ4λµÄÊýŸÝ
L_data = CMD; //xxxx0000žñÊœ
L_data &= 0x0f; //ÆÁ±Îžß4λµÄÊýŸÝ
L_data <<= 4; //xxxx0000žñÊœ
WriteByte(0xf8); //RS=0£¬ÐŽÈëµÄÊÇÖžÁ
WriteByte(H_data);
WriteByte(L_data);
}
void LCD12864RSPI::WriteData(int CMD)
{
int H_data,L_data;
H_data = CMD;
H_data &= 0xf0; //ÆÁ±ÎµÍ4λµÄÊýŸÝ
L_data = CMD; //xxxx0000žñÊœ
L_data &= 0x0f; //ÆÁ±Îžß4λµÄÊýŸÝ
L_data <<= 4; //xxxx0000žñÊœ
WriteByte(0xfa); //RS=1£¬ÐŽÈëµÄÊÇÊýŸÝ
WriteByte(H_data);
WriteByte(L_data);
}
void LCD12864RSPI::Initialise()
{
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
digitalWrite(latchPin, LOW);
delayns();
WriteCommand(0x30); //¹ŠÄÜÉè¶š¿ØÖÆ×Ö
WriteCommand(0x0c); //ÏÔÊŸ¿ª¹Ø¿ØÖÆ×Ö
WriteCommand(0x01); //Çå³ýÆÁÄ»¿ØÖÆ×Ö
WriteCommand(0x06); //œøÈëÉè¶šµã¿ØÖÆ×Ö
}
void LCD12864RSPI::CLEAR(void)
{
WriteCommand(0x30);//
WriteCommand(0x01);//Çå³ýÏÔÊŸ
}
void LCD12864RSPI::DisplayString(int X,int Y,uchar *ptr,int dat)
{
int i;
switch(X)
{
case 0: Y|=0x80;break;
case 1: Y|=0x90;break;
case 2: Y|=0x88;break;
case 3: Y|=0x98;break;
default: break;
}
WriteCommand(Y); // ¶šÎ»ÏÔÊŸÆðÊŒµØÖ·
for(i=0;i<dat;i++)
{
WriteData(ptr[i]);//ÏÔÊŸºº×ÖʱעÒâÂëÖµ£¬Á¬ÐøÁœžöÂë±íÊŸÒ»žöºº×Ö
}
}
void LCD12864RSPI::DisplaySig(int M,int N,int sig)
{
switch(M)
{
case 0: N|=0x80;break;
case 1: N|=0x90;break;
case 2: N|=0x88;break;
case 3: N|=0x98;break;
default: break;
}
WriteCommand(N); // ¶šÎ»ÏÔÊŸÆðÊŒµØÖ·
WriteData(sig); //Êä³öµ¥žö×Ö·û
}
void LCD12864RSPI::DrawFullScreen(uchar *p)
{
int ygroup,x,y,i;
int temp;
int tmp;
for(ygroup=0;ygroup<64;ygroup++) //ÐŽÈëÒºŸ§ÉϰëÍŒÏ󲿷Ö
{ //ÐŽÈë×ø±ê
if(ygroup<32)
{
x=0x80;
y=ygroup+0x80;
}
else
{
x=0x88;
y=ygroup-32+0x80;
}
WriteCommand(0x34); //ÐŽÈëÀ©³äÖžÁîÃüÁî
WriteCommand(y); //ÐŽÈëyÖá×ø±ê
WriteCommand(x); //ÐŽÈëxÖá×ø±ê
WriteCommand(0x30); //ÐŽÈë»ù±ŸÖžÁîÃüÁî
tmp=ygroup*16;
for(i=0;i<16;i++)
{
temp=p[tmp++];
WriteData(temp);
}
}
WriteCommand(0x34); //ÐŽÈëÀ©³äÖžÁîÃüÁî
WriteCommand(0x36); //ÏÔÊŸÍŒÏó
}
void LCD12864RSPI::img1(uchar img[])
{
unsigned int i;
unsigned char page,column;
for(page=0xB0;page<0xB4;page++)
{
WriteCommand(page); //set page address
WriteCommand(0x10); //set Column address MSB
WriteCommand(0x04); //set column address LSB
i = (0xB3-page)*128;
for(column=0;column<128;column++)
{
WriteData(~img[i+column]);
}
}
WriteCommand(0x34); //ÐŽÈëÀ©³äÖžÁîÃüÁî
WriteCommand(0x36); //ÏÔÊŸÍŒÏó
}
void LCD12864RSPI::img2(uchar img[])
{
unsigned int i;
unsigned char page,column;
for(page=0xB4;page<0xB8;page++)
{
WriteCommand(page); //set page address
WriteCommand(0x10); //set Column address MSB
WriteCommand(0x04); //set column address LSB
i = (0xB7-page)*128;
for(column=0;column<128;column++)
{
WriteData(~img[i+column]);
}
}
WriteCommand(0x34); //ÐŽÈëÀ©³äÖžÁîÃüÁî
WriteCommand(0x36); //ÏÔÊŸÍŒÏó
}
LCD12864RSPI LCDA = LCD12864RSPI();
***
Thanks for your assistance!

2013-03-25 18:29:01 Hi
You should open the sample code like this:
Open Arduino IDE-> Files->Examples->LCD12864RSPI->LCD12864_test :)
if you copy the sample code to the Arduino IDE. the same file should include another two files
Phoebe
You should open the sample code like this:
Open Arduino IDE-> Files->Examples->LCD12864RSPI->LCD12864_test :)
if you copy the sample code to the Arduino IDE. the same file should include another two files

2013-03-24 10:16:03 Thanks for the reply, ;) but still not compling...
I use the sample code (same as first post, btw) and the library you linked (SPI mode) and get this with IDE 1.0.4:
C:\Users\leo\Desktop\arduino-1.0.4-windows\arduino-1.0.4\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=104 -IC:\Users\leo\Desktop\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\cores\arduino -IC:\Users\leo\Desktop\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\variants\standard -IC:\Users\leo\Desktop\arduino-1.0.4-windows\arduino-1.0.4\libraries\LCD12864RSPI C:\Users\leo\AppData\Local\Temp\build7607982498805387058.tmp\sketch_mar23a.cpp -o C:\Users\leo\AppData\Local\Temp\build7607982498805387058.tmp\sketch_mar23a.cpp.o
sketch_mar23a.ino:29:25: error: DFrobot_bmp.h: No such file or directory
sketch_mar23a.ino:30:26: error: DFrobot_char.h: No such file or directory
sketch_mar23a.ino: In function 'void setup()':
sketch_mar23a:47: error: 'logo' was not declared in this scope
sketch_mar23a.ino: In function 'void loop()':
sketch_mar23a:65: error: 'show1' was not declared in this scope
sketch_mar23a:67: error: 'show2' was not declared in this scope
sketch_mar23a:69: error: 'show3' was not declared in this scope
I decompress library raw in libraries folder and leave as it comes.
Whats wrong?
Thank you!
boleo80
I use the sample code (same as first post, btw) and the library you linked (SPI mode) and get this with IDE 1.0.4:
C:\Users\leo\Desktop\arduino-1.0.4-windows\arduino-1.0.4\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=104 -IC:\Users\leo\Desktop\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\cores\arduino -IC:\Users\leo\Desktop\arduino-1.0.4-windows\arduino-1.0.4\hardware\arduino\variants\standard -IC:\Users\leo\Desktop\arduino-1.0.4-windows\arduino-1.0.4\libraries\LCD12864RSPI C:\Users\leo\AppData\Local\Temp\build7607982498805387058.tmp\sketch_mar23a.cpp -o C:\Users\leo\AppData\Local\Temp\build7607982498805387058.tmp\sketch_mar23a.cpp.o
sketch_mar23a.ino:29:25: error: DFrobot_bmp.h: No such file or directory
sketch_mar23a.ino:30:26: error: DFrobot_char.h: No such file or directory
sketch_mar23a.ino: In function 'void setup()':
sketch_mar23a:47: error: 'logo' was not declared in this scope
sketch_mar23a.ino: In function 'void loop()':
sketch_mar23a:65: error: 'show1' was not declared in this scope
sketch_mar23a:67: error: 'show2' was not declared in this scope
sketch_mar23a:69: error: 'show3' was not declared in this scope
I decompress library raw in libraries folder and leave as it comes.
Whats wrong?
Thank you!

2013-03-21 19:28:13 Hi
The libraries we have already update, it can support Arduino IDE1.0 and up
[url=https://www.dfrobot.com/index.php?route=product/product&filter_name=DFR0091&product_id=372#.UUpzzRz-GeE]https://www.dfrobot.com/index.php?route=product/product&filter_name=DFR0091&product_id=372#.UUpzzRz-GeE[/url]
Phoebe
The libraries we have already update, it can support Arduino IDE1.0 and up
[url=https://www.dfrobot.com/index.php?route=product/product&filter_name=DFR0091&product_id=372#.UUpzzRz-GeE]https://www.dfrobot.com/index.php?route=product/product&filter_name=DFR0091&product_id=372#.UUpzzRz-GeE[/url]
