Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
atmel:giant_lcd_shield [2012/08/11 04:15] – minerva9 | atmel:giant_lcd_shield [2013/06/23 11:56] (current) – minerva9 | ||
---|---|---|---|
Line 8: | Line 8: | ||
< | < | ||
- | ** [[http:// | + | ** [[http:// |
</ | </ | ||
Line 14: | Line 14: | ||
{{: | {{: | ||
+ | |||
+ | {{: | ||
=== LCD Details === | === LCD Details === | ||
- | [[http:// | + | [[http:// |
LCD has a contrast adjustment slider. Unlike many other LCDs, this one has good readability in bright sunlight. | LCD has a contrast adjustment slider. Unlike many other LCDs, this one has good readability in bright sunlight. | ||
Line 66: | Line 68: | ||
* Solder pins in place. Be careful, the pins are pretty close to each other. Check for any shorting as you go. | * Solder pins in place. Be careful, the pins are pretty close to each other. Check for any shorting as you go. | ||
* Close the LCD connector - best to use a small screwdriver to do this | * Close the LCD connector - best to use a small screwdriver to do this | ||
+ | * Finish tightening the screws into the standoffs | ||
Line 101: | Line 104: | ||
Note that the special commands are triggered by the backslash ‘\’ character. If you require to print a ‘\’, you must send it twice ‘\\’. | Note that the special commands are triggered by the backslash ‘\’ character. If you require to print a ‘\’, you must send it twice ‘\\’. | ||
- | The following sketch shows several of the features of this display. In order to save the Arduino serial port for other purposes, we use the [[http://arduiniana.org/libraries/newsoftserial/|'NewSoftSerial']] library. Be sure to install this into your Arduino build environment. | + | The following sketch shows several of the features of this display. In order to save the Arduino serial port for other purposes, we use the [[http://arduino.cc/en/Reference/SoftwareSerial|'SoftwareSerial']] library. |
<code c> | <code c> | ||
- | #include <NewSoftSerial.h> | + | #include <SoftwareSerial.h> |
+ | //Compiled with Arduino Version 1.0.5 | ||
//We are using Arduino Uno pins 3 (Receive) and 4 (Transmit) | //We are using Arduino Uno pins 3 (Receive) and 4 (Transmit) | ||
//This demo actually just uses pin 4 - there is no reception of data | //This demo actually just uses pin 4 - there is no reception of data | ||
- | NewSoftSerial | + | SoftwareSerial |
void setup() | void setup() | ||
{ | { | ||
- | Serial.begin(57600); | + | |
- | Serial.println(" | + | |
| | ||
- | // Set the data rate for the NewSoftSerial | + | // Set the data rate for the SoftwareSerial |
// The LCD display expects 9600 baud | // The LCD display expects 9600 baud | ||
mySerial.begin(9600); | mySerial.begin(9600); | ||
+ | // Give the LCD time to complete its reset cycle | ||
+ | delay (3000); | ||
} | } | ||
Line 124: | Line 130: | ||
//note that we need two ' | //note that we need two ' | ||
mySerial.print(" | mySerial.print(" | ||
+ | |||
delay (2000); | delay (2000); | ||
+ | |||
mySerial.print(" | mySerial.print(" | ||
// | // | ||
Line 130: | Line 138: | ||
//Set cursor position to 2nd char of 3rd row | //Set cursor position to 2nd char of 3rd row | ||
- | //Note that we need to escape the " character, giving us \" | ||
mySerial.print(" | mySerial.print(" | ||
mySerial.print(" | mySerial.print(" | ||
Line 214: | Line 221: | ||
+ | x: | ||
//clear screen & select font 0 | //clear screen & select font 0 | ||
mySerial.print(" | mySerial.print(" | ||
| | ||
- | //show 'graph drawing' | ||
int dly = 80; | int dly = 80; | ||
| | ||
Line 227: | Line 234: | ||
| | ||
for (int i=0; i <= 7; i++) { | for (int i=0; i <= 7; i++) { | ||
+ | //position cursor | ||
mySerial.print(" | mySerial.print(" | ||
- | mySerial.print(byte(k)); | + | |
- | mySerial.print(byte(j)); | + | |
+ | //row position | ||
+ | mySerial.write(byte(j)); | ||
- | mySerial.print(byte(152 + i)); | + | mySerial.write(byte(152 + i)); |
delay(dly); | delay(dly); | ||
} | } | ||
mySerial.print(" | mySerial.print(" | ||
- | mySerial.print(byte(k)); | + | mySerial.write(byte(k)); |
- | mySerial.print(byte(j)); | + | mySerial.write(byte(j)); |
//full block char is font 0, char 136 | //full block char is font 0, char 136 | ||
- | mySerial.print(byte(136)); | + | mySerial.write(byte(136)); |
delay(dly); | delay(dly); | ||
} | } | ||
Line 246: | Line 256: | ||
} | } | ||
</ | </ | ||
- | {{tag> | + | {{tag> |