Go Down

Topic: 4x20 ATMega1280 (Read 3232 times) previous topic - next topic

T.E. Riggs

Can someone email me a working wiring diagram connecting a 4 x 20 AMC2004AR Standard type 16 pin LCD to a ATmeaga1280 with a short sample code I am having trouble with mine it just lights up but doesn't do anything and I need something to compare to.
Thanks.             My email shouldn't be hidden.

floresta

You should start by following the tutorial at http://www.ladyada.net/learn/lcd/charlcd.html.  That tutorial is for a 16x2 LCD but it will work without modification for your 20x4 device.  You could change the lcd.begin() argument to match your device but it won't really make any difference.

Don

Staedtler




Here is a very basic diagram (without trim pots)...




... then you can use this code ...

Code: [Select]
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

void setup() {
 
lcd.clear();
lcd.begin(20, 4); // 20 ROWS / 4 LINES

             }
             
             
             void loop()


{
 
lcd.clear();  
lcd.setCursor(0,0); lcd.print("*------------------*");
lcd.setCursor(0,1); lcd.print("!      Wassap      !");
lcd.setCursor(0,2); lcd.print("!  LCD AMC2004AR?  !");
lcd.setCursor(0,3); lcd.print("*------------------*");
delay(100);

lcd.clear();  
lcd.setCursor(0,0); lcd.print("+!!!!!!!!!!!!!!!!!!+");
lcd.setCursor(0,1); lcd.print("-      Wassap      -");
lcd.setCursor(0,2); lcd.print("_  LCD AMC2004AR?  -");
lcd.setCursor(0,3); lcd.print("+!!!!!!!!!!!!!!!!!!+");
delay(100);

}
--------------------------------------
Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?'
- 'Yeah', reply the bytes

floresta

Quote

... then you can use this code ...

And the purpose of using two instances of the code along with the delays within 'loop' as opposed to putting one instance of the code without any delays within 'setup' is ...?

Don

Staedtler

#4
Jan 30, 2011, 11:43 pm Last Edit: Jan 30, 2011, 11:57 pm by Staedtler Reason: 1

Quote

... then you can use this code ...

And the purpose of using two instances of the code along with the delays within 'loop' as opposed to putting one instance of the code without any delays within 'setup' is ...?

Don


This is just an animated "Hello World"... that's it.

I was expecting critiques on using "lcd.clear();" where is unnecessary  ... but the purpose of those two "delay(100);" is to generate a simple animation.

--------------------------------------
Eight bytes walk into a bar. The bartender asks, 'Can I get you anything?'
- 'Yeah', reply the bytes

T.E. Riggs

Mr Staedtler I wanted to thank you for the code and schmatic it helped me track down a faulty pot and now my LCD works fine. And thanks to the other replys it all helped and I got to see the cute antimation.
TERiggs

Go Up