Skip to main content
Commonmark migration
Source Link

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

 

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

 

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

 

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

EDIT 2: Fritzing View Hopefully it is correctly wired up.

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

 

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

 

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

 

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

EDIT 2: Fritzing View Hopefully it is correctly wired up.

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

EDIT 2: Fritzing View Hopefully it is correctly wired up.

deleted 4 characters in body
Source Link
MKII
  • 111
  • 4

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

EDIT 2: Fritzing ViewFritzing View Hopefully it is correctly wired up.

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

EDIT 2: Fritzing View Hopefully it is correctly wired up.

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

EDIT 2: Fritzing View Hopefully it is correctly wired up.

Added image
Source Link
MKII
  • 111
  • 4

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

EDIT 2: Fritzing View Hopefully it is correctly wired up.

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

I have an Arduino Uno connected to a LCD. When I try to write to it using the LCD library and the following sketch, it will keep shifting the output around, sometimes drastically.

The sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

void setup () 
{
  lcd.begin (16, 2);
}

void loop () 
{
  lcd.clear ();
  lcd.home ();
  
  for (int i = 0; i < 2; i++)
  {
    for (int j = 0; j < 16; j++)
    {
      lcd.setCursor (j, i);
      lcd.print ("s");
    }
  }

  delay (1000);
}

You would expect it to print

SSSSSSSSSSSSSSSS

SSSSSSSSSSSSSSSS

But it will often print

SSSSSSSSSSSSSSS

SSSSSSSSSSSSSSS

As in, it skips the first line. And, occasionally, it will even print like this:

SSSSSSSSSSS

SSSSSSSSSSS

Is it the LCD's fault, or might there be something wrong with the way it is connected?

EDIT: It is a common Hitachi HD44780-compatible LCD.

EDIT 2: Fritzing View Hopefully it is correctly wired up.

added 57 characters in body
Source Link
MKII
  • 111
  • 4
Loading
Source Link
MKII
  • 111
  • 4
Loading