Pages: [1]   Go Down
Author Topic: 4x20 ATMega1280  (Read 2652 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4118
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dallas, TX
Offline Offline
Jr. Member
**
Karma: 5
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset




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




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

Code:
#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);

}
Logged

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

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4118
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dallas, TX
Offline Offline
Jr. Member
**
Karma: 5
Posts: 91
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

« Last Edit: January 30, 2011, 05:57:37 pm by Staedtler » Logged

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: