0

for a school project I need to program a display. I've got in almost working. I made a setup screen in the setup() that just says our groupname and the name of our project for 8 seconds (this works perfectly). After the 8 seconds, I used lcd.clear() and tried to type another line. But after the 8 seconds all it shows are 32 white squares. Anyone has any idea how to fix this?

#include <SoftwareSerial.h> // use the software uart

include <Wire.h>

include <LCD.h>

include <LiquidCrystal_I2C.h>  // F Malpartida's NewLiquidCrystal library

define I2C_ADDR       0x3F // Define I2C Address (use i2c scanner if >necessary)

define BACKLIGHT_PIN  3

define En_pin         2

define Rw_pin         1

define Rs_pin         0

define D4_pin         4

define D5_pin         5

define D6_pin         6

define D7_pin         7


define LED_OFF        0

define LED_ON         1

int x = 5;

/*-----( Declare objects )-----*/  

LiquidCrystal_I2C 
lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);


SoftwareSerial bluetooth(10, 9); // RX, TX

int CurrentCommandASCII = 0; // dit is het commando in ASCII

char CurrentCommand ;// Hier wordt het commando omgezet naar Letters


void setup() {
  bluetooth.begin(9600); // start bluetooth

  Wire.begin();

  delay(200); 

  Serial.begin(9600); // start seriele monitor

     pinMode(13, OUTPUT);


   digitalWrite(13, HIGH);

      lcd.begin (16,2);  // initialize the lcd

    // Switch on the backlight


    lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);

    lcd.setBacklight(LED_ON);

        // Reset the display  

    lcd.clear();

    lcd.home();

    lcd.setCursor(4,0); // Start at character 0 on line 0

    lcd.print("Test");

    delay(1000);

    lcd.setCursor(5,1); // Start at character 0 on line 1

    lcd.print("Test");

    delay(8000);

 lcd.clear();
  • 32 white squares: Is that the entire display, or just part of it? (how many characters can it display in total?) Perhaps the contrast should be adjusted? – jose can u c Feb 2 at 14:01
  • Add your sketch. – Michel Keijzers Feb 2 at 14:06
  • 1
    Jose can u c It is a 16x2 display so indeed the whole screen is filled with white blocks. I btw use a lcd display with backpack. i tried adjusting contrast but it doesn't work – user53595 Feb 2 at 14:08
  • Please add a schematic as to how exactly everything is connected. – stevieb Feb 2 at 16:17
  • your code is incomplete – jsotola Feb 3 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.