I need help with LiquidCrystal.h

hi
Intended to set other pins with LiquidCrystal.h library but I'm having some difficulties.
The pins that are intended to:
RS -----> PA4
Enable -----> PA5
DB4 -----> PA3
DB5 -----> PA2
DB6 -----> PA1
DB7 -----> PA0

These pins are the Arduino Mega 2560
I tried to pin down this out "LiquidCrystal lcd (A4, A5, A3, A2, A1, A0);" not working.
How can the LCD by working with these pins.

Thank you
José Rodrigues

did you set the pinMode of those pins? (just don't know if the lib does that for you)

I have also tried with this form:
LiquidCrystal lcd (26, 27, 25, 24, 23, 22);
LiquidCrystal lcd (58, 59, 57, 56, 55, 54);
But it also does not work.

Thank you
José Rodrigues

Any idea how I can solve the problem.

we often say

  • post your whole code
  • post your schematic
  • post links to the hardware you use
  • post as much info as you can give about the problem and its context
  • and tell what you tried sofar

but lets start with the top 3 (code & schematic & links)

robtillaart:
we often say

  • post your whole code
  • post your schematic
  • post links to the hardware you use
  • post as much info as you can give about the problem and its context
  • and tell what you tried sofar

but lets start with the top 3 (code & schematic & links)

I apologize for being only answer now, but was not possible before.
The code I used is the example of Arduino "Hello World", the only change I made was on the pins as shown above.
The board I am using is the Arduino Mega 2560 R3 and LCD 16x2
The scheme I am using is what is in the picture:
http://imageshack.com/a/img853/169/eanz.jpg
I have this schema to work with other code but without the LiquidCrystal library.
As I intend to do just an experiment, I did not use the other code because it's too complicated for me.

thank you
José Rodrigues

Any idea how I can solve the problem.

jose,
When you use the term "PA4" that is not the same as A4 on the Arduino board.
PA4 refers to the pin using PORTA bit 4.
Normally when using arduino you use the Arduino pin numbers and names as that
is what their API uses.
Are you really wanting to use direct AVR pins?

My recommendation is to stick to using the Arduino pin names and numbers
since that is what all the Arduino APIs need/use.

But if you really want to use the raw AVR port/bit numbers and specify a direct pin
you can still do that but you will have to manually translate that to an Arduino
pin number/name.

--- bill

bperrybap:
jose,
When you use the term "PA4" that is not the same as A4 on the Arduino board.
PA4 refers to the pin using PORTA bit 4.
Normally when using arduino you use the Arduino pin numbers and names as that
is what their API uses.
Are you really wanting to use direct AVR pins?

My recommendation is to stick to using the Arduino pin names and numbers
since that is what all the Arduino APIs need/use.

But if you really want to use the raw AVR port/bit numbers and specify a direct pin
you can still do that but you will have to manually translate that to an Arduino
pin number/name.

--- bill

When I put PA4 wanted to say that the PORTA bit 4
What are the I am using the Arduino Mega 2560
The pins A0 - A15 are the analog, I actually used the Pins on top 54-59 but should not have used, as are the analog ports.
The pins for the ports that are intend to use the 22-27, but is not working with them.

Thank you
José Rodrigues

The picture of the mega that you showed matches this constructor:

LiquidCrystal lcd (26, 27, 25, 24, 23, 22);

What we need now, as requested earlier, is the full sketch you are using
and a clear photo of your hardware.

We need photo that is clear enoug so that we can see all the wires and verify it against
the constructor you have in your code.

i.e. we enough information such that we could re-create everything.

--- bill

Have managed to solve the problem had changed the enable with the RS, now works.

Thanks for everything
José Rodrigues