I'm trying to recycle parts of the adafruit glcd demo by replacing everything downstream of the splash screen with a serial read, but im getting errors.
I'm new to programming so i have no clue what im doing here.
The code:
#include "ST7565.h"
int ledPin = 10; // LED connected to digital pin 13
// the LCD backlight is connected up to a pin so you can turn it on & off
#define BACKLIGHT_LED 10// pin 9 - Serial data out (SID)
// pin 8 - Serial clock out (SCLK)
// pin 7 - Data/Command select (RS or A0)
// pin 6 - LCD reset (RST)
// pin 5 - LCD chip select (CS)
ST7565 glcd(9, 8, 7, 6, 5);#define LOGO16_GLCD_HEIGHT 16
#define LOGO16_GLCD_WIDTH 16// The setup() method runs once, when the sketch starts
void setup() {Serial.begin(9600);
// turn on backlight
pinMode(BACKLIGHT_LED, OUTPUT);
digitalWrite(BACKLIGHT_LED, HIGH);// initialize and set the contrast to 0x18
glcd.begin(0x10);glcd.display(); // show splashscreen
delay(2000);
glcd.clear();
}void loop()
{
char c;// when characters arrive over the serial port...
if (Serial.available())
{
// read character from serial library buffer
c = Serial.read();// display character on glcd
GLCD.write(c); // use Print class for output// could also use gText character output routine
// GLCD.PutChar(c);
}
};