Go Down

Topic: pongLCD in LCD12864 (Read 411 times) previous topic - next topic

oJohn

hi, i download http://playground.arduino.cc/uploads/Code/LCD12864.zip library and use it to play in my http://playground.arduino.cc/uploads/Code/pongLCD.zip game, but it can't work. It shows wrong message 'LCDA' was not declared in this scope, can anybody help me?

GrooveFlotilla

#1
Mar 12, 2018, 12:03 pm Last Edit: Mar 12, 2018, 12:18 pm by GrooveFlotilla
Quote
It shows wrong message 'LCDA' was not declared in this scope
If LCDA was not declared in that scope, surely that's the right message?

Where is your code?
Some people are like Slinkies.

Not really good for anything, but they bring a smile to your face when pushed down the stairs.

oJohn

My code is http://playground.arduino.cc/uploads/Code/pongLCD.zip, but it doesn't work.

GrooveFlotilla

#3
Mar 16, 2018, 10:56 am Last Edit: Mar 16, 2018, 10:57 am by GrooveFlotilla
And where is all of the error message?
I'll bet it contains some useful clues to your problem
Some people are like Slinkies.

Not really good for anything, but they bring a smile to your face when pushed down the stairs.

oJohn

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (Windows XP), Board: "Arduino Uno"
sketch_mar16a.ino:1:22: error: LCD12864.h: No such file or directory
sketch_mar16a.ino: In function 'void setup()':
sketch_mar16a:30: error: 'LCDA' was not declared in this scope
sketch_mar16a.ino: In function 'void run()':
sketch_mar16a:126: error: 'LCDA' was not declared in this scope
sketch_mar16a.ino: In function 'void numbertobinary(char)':
sketch_mar16a:145: error: 'LCDA' was not declared in this scope
sketch_mar16a:147: error: 'LCDA' was not declared in this scope
sketch_mar16a:149: error: 'LCDA' was not declared in this scope
sketch_mar16a:151: error: 'LCDA' was not declared in this scope
sketch_mar16a:153: error: 'LCDA' was not declared in this scope
sketch_mar16a:155: error: 'LCDA' was not declared in this scope
sketch_mar16a:157: error: 'LCDA' was not declared in this scope
sketch_mar16a:159: error: 'LCDA' was not declared in this scope
sketch_mar16a:161: error: 'LCDA' was not declared in this scope
sketch_mar16a:163: error: 'LCDA' was not declared in this scope
sketch_mar16a.ino: In function 'void Title()':
sketch_mar16a:167: error: 'LCDA' was not declared in this scope
sketch_mar16a.ino: In function 'void scored()':
sketch_mar16a:190: error: 'LCDA' was not declared in this scope

GrooveFlotilla

Code: [Select]
error: LCD12864.h: No such file or directoryAnd there's your clue.

Where did you put the library?
Some people are like Slinkies.

Not really good for anything, but they bring a smile to your face when pushed down the stairs.

oJohn

I got it. But there are new wrong messages:
  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (Windows XP), Board: "Arduino Uno"
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp: In member function 'void LCD12864::selectCS1()':
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:74: error: 'digitalWrite' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp: In member function 'void LCD12864::Initialise()':
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:82: error: 'B00000001' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:83: error: 'B00000010' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:84: error: 'B00000100' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:85: error: 'B00001000' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:86: error: 'B00010000' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:87: error: 'B00100000' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:88: error: 'B01000000' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:89: error: 'B10000000' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:92: error: 'OUTPUT' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:92: error: 'pinMode' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp: In member function 'void LCD12864::DrawBrLine(uint8_t, uint8_t, uint8_t, uint8_t)':
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:304: error: 'abs' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp: In member function 'void LCD12864::setPins(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)':
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:487: error: 'digitalWrite' was not declared in this scope
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp: In member function 'void LCD12864::delayns()':
C:\Program Files\Arduino\libraries\LCD12864\LCD12864.cpp:507: error: 'delayMicroseconds' was not declared in this scope

oJohn

Does it mean that the library have wrong declaration?

bperrybap

You need to turn on verbose mode to be able see all the warnings and error messages.
That library was written for pre 1.x IDE.
It is VERY VERY old and no longer works with todays IDE and avr-gcc tools.
Things were quite different then. To get it to run on 1.x you will have to modify the code to get it work.
Things like changing  the use of wiring.h to use Arduino.h and eliminating the use of the prog_char types as they no longer exist.

Also,
Quote
Arduino: 1.0.6 (Windows XP)
This indicates that you are using a REALLY old IDE.
There have been many updates to the IDE since then.

I would recommend using a newer IDE version.

If you are looking for a library that works with the  ST7920 chip, the have a look at u8glib or u8g2.
If you use a newer IDE, you can use the IDE library manager to install u8g2.

--- bill


oJohn

Thanks, I successfully compile the code in Arduino IDE 0022 version, but when I want to upload it to the I/O  board, I run into difficulties. It says it can't find the drivers, but when I direct the path to the IDE 0022 version driver folder, it can't install it. Can you teach me how to install the drivers? Thank you.

bperrybap

Can't help you with driver issues.
I'm assuming you are using Windows which I don't use.
I use Linux and Linux doesn't have driver issues like Windows does.

There are many differences between pre and post 1.0 IDE versions.
If you go back to using a pre 1.x IDE you will soon find that many sketches and libraries that will not work with such an old version of the IDE due to many API changes.
There are many very useful updates, new features, and bug fixes in the 1.5x IDE code with the latest ide being 1.8.5.

That glcd library that you are trying to use is about 9 years old. MANY things have changed since then.
I'd still recommend that use use a newer IDE and either fix the library code to run on the newer IDE or use a different library like u8g2 that is actively being maintained.
The current IDEs have a library manager that allow you to find and install libraries directly from the IDE GUI.


--- bill

oJohn

But if I use newer IDE and newer libraries, I cannot play the pong game because there is no new code for new IDE and new libraies. Doesn't it?

oJohn

bperrybap, could you tell me WHAT things have changed since 9 years ago?

bperrybap

bperrybap, could you tell me WHAT things have changed since 9 years ago?
Seriously? That is a HUGE list of things.
Feel free to review the release notes:
https://www.arduino.cc/en/Main/ReleaseNotes
Just keep in mind that they don't reflect all the changes,
To see everything that has changed look through the actual source code and the commit history.
https://github.com/arduino/Arduino

--- bill

Go Up