Hello! I’m having a bit of trouble with my project. It’s Project 23 from “Arduino Basics” by Michael McRoberts. Only the backlights of the LCD are functioning, and I haven’t been able to make it write. Here’s the code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
lcd.begin(16, 2);
}
void loop() {
basicPrintDemo();
displayOnOffDemo();
setCursorDemo();
scrollLeftDemo();
scrollRightDemo();
cursorDemo();
createGlyphDemo();
}
void basicPrintDemo(){
lcd.clear();
lcd.print ("basic print");
delay(2000);
}
void displayOnOffDemo(){
lcd.clear();
lcd.print ("display On/Off");
for (int x=0; x<3; x++){
lcd.noDisplay();
delay(1000);
lcd.display();
delay(1000);
}
}
void setCursorDemo() {
lcd.clear();
lcd.print ("Set Cursor Demo");
delay(1000);
lcd.clear();
lcd.setCursor(5,0);
lcd.print ("5, 0");
delay(2000);
lcd.setCursor(10, 1);
lcd.print ("10, 1");
delay(2000);
lcd.setCursor(3, 1);
lcd.print ("3, 1");
delay(2000);
}
void scrollLeftDemo() {
lcd.clear();
lcd.print ("Scroll Left Demo");
delay(1000);
lcd.clear();
lcd.setCursor(7,0);
lcd.print("beggining");
lcd.setCursor(9,1);
lcd.print ("Arduino");
delay(1000);
for (int x=0; x<16; x++) {
lcd.scrollDisplayLeft();
delay(250);
}
}
void scrollRightDemo(){
lcd.clear();
lcd.print ("Scroll Right");
lcd.setCursor (0, 1);
lcd.print ("demo");
delay(1000);
lcd.clear();
lcd.print("beggining");
lcd.setCursor(0,1);
lcd.print ("Arduino");
delay(1000);
for (int x=0; x<16; x++) {
lcd.scrollDisplayRight();
delay(250);
}
}
void cursorDemo() {
lcd.clear();
lcd.cursor();
lcd.print ("Cursor On");
delay(3000);
lcd.clear();
lcd.noCursor();
lcd.print ("Cursor Off");
delay(3000);
lcd.clear();
lcd.cursor();
lcd.blink();
lcd.print ("Cursor Blink On");
delay(3000);
lcd.noCursor();
lcd.noBlink();
}
void createGlyphDemo() {
lcd.clear();
byte happy[8] = {
B00000,
B00000,
B10001,
B00000,
B10001,
B01110,
B00000,
B00000};
byte sad[8] = {
B00000,
B00000,
B10001,
B00000,
B01110,
B10001,
B00000,
B00000};
lcd.createChar (2, happy);
lcd.createChar (1, sad);
for (int x=0; x<5; x++) {
lcd.setCursor(8,0);
lcd.write(2);
delay(1000);
lcd.setCursor(8,0);
lcd.write(1);
delay(1000);
}
}
Here are some pictures of how everything is set up, I believe it complies to the code:
I hope they are sufficient to decipher the mess of wires that’s going on down there
The LCD screen is a qapass 1602a. Has required by the book this experiment is from, I’m using a 10k ohms resistor for the contrast, but for the Vee pin I’m using a 270R resistor (the book gives you no guidance on that regard). Maybe that is the issue? I would appreciate assistance.