atmel:giant_lcd_shield

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
atmel:giant_lcd_shield [2013/05/27 16:01] minerva9atmel:giant_lcd_shield [2013/06/21 13:24] minerva9
Line 101: Line 101:
 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 mySerial(3, 4);+SoftwareSerial mySerial(3, 4);
  
 void setup()   void setup()  
 { {
-  Serial.begin(57600); +  // Serial.begin(57600); 
-  Serial.println("Giant LCD Test");+  // Serial.println("Giant LCD Test");
      
-  // Set the data rate for the NewSoftSerial port+  // Set the data rate for the SoftwareSerial port
   // 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 127:
   //note that we need two '\' chars as Arduino takes a single '\' as the escape character   //note that we need two '\' chars as Arduino takes a single '\' as the escape character
   mySerial.print("\\@ 0");    mySerial.print("\\@ 0"); 
 + 
   delay (2000);   delay (2000);
 +
   mySerial.print("Line 1 - Hello world");   mySerial.print("Line 1 - Hello world");
   //   //
Line 130: Line 135:
  
   //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("\\B\"#");   mySerial.print("\\B\"#");
   mySerial.print("Cursor positioning");   mySerial.print("Cursor positioning");
Line 214: Line 218:
    
    
 + x:
   //clear screen & select font 0    //clear screen & select font 0 
   mySerial.print("\\@ 0");   mySerial.print("\\@ 0");
      
-  //show 'graph drawing'  
   int dly = 80;   int dly = 80;
      
Line 227: Line 231:
          
     for (int i=0; i <= 7; i++) {     for (int i=0; i <= 7; i++) {
 +      //position cursor
       mySerial.print("\\B");       mySerial.print("\\B");
-      mySerial.print(byte(k)); +      //character position 
-      mySerial.print(byte(j));+      mySerial.write(byte(k)); 
 +      //row position 
 +      mySerial.write(byte(j));
  
-      mySerial.print(byte(152 + i));+      mySerial.write(byte(152 + i));
       delay(dly);       delay(dly);
    }    }
   mySerial.print("\\B");   mySerial.print("\\B");
-  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);
   }   }
  • atmel/giant_lcd_shield.txt
  • Last modified: 2013/06/23 11:56
  • by minerva9