Got one arduino Nanu with 328 IC.
I am ok with blinking an led so it is working fine. But I am having problem interfacing it with my new 40x4 LCD character display.
In file included from C:\Users\singh_000\Documents\Arduino\RAILWAY_CHALLENGE\RC\RC.ino:1:0:
C:\Users\singh_000\Documents\Arduino\libraries\Liquidcrystal440/LiquidCrystal440.h:95:16: error: conflicting return type specified for 'virtual void LiquidCrystal::write(uint8_t)'
virtual void write(uint8_t);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from sketch\RC.ino.cpp:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:48:20: error: overriding 'virtual size_t Print::write(uint8_t)'
virtual size_t write(uint8_t) = 0;
^
exit status 1
Error compiling.
I have double checked the connections and they are correct and as follows:
You might need an updated LiquidCrystal Library. Versions 1.6.6 and 1.6.7 of the IDE revealed a bug in some early Liquid Crystal Libraries, which -- incorrectly -- used write() as a void, when it needs to return an int (the number of chars written). Earlier versions of the IDE did not seem to care, but now, they do!
Try updating your library (you could try NewLiquidCrystal or others) and see if the compiler problem goes away.
The original LiquidCrystal440 library was written for the Pre Arduino 1.0 IDE. Did you download and use the later version designed for the current IDE? To get a copy start here:--> Google Code Archive - Long-term storage for Google Code Project Hosting. and follow the Downloads link to get to the latest version.
If that part is OK then take advantage of the fact that your 40x4 display is really set up as two 40x2 devices with all of their pins connected in parallel except for 'E'.
Try using the regular LiquidCrystal library with your program changing the LiquidCrystal.lcd(...) and the lcd.begin(...) arguments of course.
Connect both chip selects of your display to the same Arduino pin and you should get your message on rows 1 and 3 when you run your program.
If that works you can then use two instances of the regular LiquidCrystal library to drive your display. Ask if you need help figuring that part out.
Thanks all. I tried changing the value to 16x2. It showed hello world on first line (left hand side).
I swapped E1 with E2 and the bottom two lines started showing the same text.
I joined both together and I get the same same text on both pair of lines as advised.
What should I do next please?
( I extend the text to cover 39 characters) so both lines show it.
I joined both together and I get the same same text on both pair of lines as advised.
This means that there's nothing wrong with your display and that you apparently know how to get your constructor to match your wiring.
What should I do next please?
Did you follow the link in reply #2 and get the updated version of LiquidCrystal440 (which now has a different name) that works with the current versions of the Arduino IDE?
Did you follow the link in reply #2 and get the updated version of LiquidCrystal440 (which now has a different name) that works with the current versions of the Arduino IDE?
//-------------------------------------------------------------------------
In file included from C:\Users\singh_000\Documents\Arduino\RAILWAY_CHALLENGE\RC\RC.ino:1:0:
C:\Users\singh_000\Documents\Arduino\libraries\Liquidcrystal440/LiquidCrystal440.h:95:16: error: conflicting return type specified for 'virtual void LiquidCrystal::write(uint8_t)'
virtual void write(uint8_t);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
Now go back and download the latest version from the link that I provided in reply #2.
You may not be old enough to remember the Black Flag 'Roach Motel' commercials from the early 1980s. The tag line was "Roaches check in, but they don't check out!".
Well, the Arduino playground is something like that. It seems to be relatively easy to post something to the playground but it seems to be impossible to get anything removed. This not only includes obsolete information such as the link you posted but also incorrect or incomplete information.
If you follow the instructions in reply #2 you will ultimately get to the version of John's library that was updated for the Arduino 1.0+ versions of the IDE. The filename is LiquidCrystal1.0.zip .
/* The circuit:
* LCD RS pin to digital pin 7
* LCD Enable pin to digital pin 6
* LCD Enable2 pin to digital pin 8
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
*/
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7,6,8,5,4,3,2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(40, 4);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
}
Here you go. It was a typo earlier- not closing the commented block
No it does not. It does not print anything on the screen when I upload the above code. I am able to do it with lcd1 and lcd2. Would be nice to do it as one lcd.
I just noticed this in the project description for the library. It looks like you need eight entries in your descriptor.
To use an LCD with 4 lines and 40 columns you would declare your LiquidCrystal object as: LiquidCrystal lcd(RS,RW,Enable1,Enable2, data3,data2,data1,data0); at this time I don’t support 8 data lines. (You can pass 255 as the RW item, ground RW and save an Arduino pin.)
floresta:
I just noticed this in the project description for the library. It looks like you need eight entries in your descriptor.
To use an LCD with 4 lines and 40 columns you would declare your LiquidCrystal object as: LiquidCrystal lcd(RS,RW,Enable1,Enable2, data3,data2,data1,data0); at this time I don’t support 8 data lines. (You can pass 255 as the RW item, ground RW and save an Arduino pin.)[/u]
Don
That is what I did. I grounded the RW pin so I can free an Arduino pin for something else. But at the same I need to declare 8 entries in LiquidCrystal - I am a little confused here. What should I write for RW entry?
ok, thanks for the help. I got the answer but I could not edit my last post. When I use (7,255,6,8,....) it starts working normally. Thanks to everyone who tried to help again.