16x2 LCD prints foreign letters?

Forget that. But the cursor doesn't show. But the symbols do.

The cursor is not shown by default. I think the 'lcd.cursor()' command is used to turn it on.

Don

floresta:

Forget that. But the cursor doesn't show. But the symbols do.

The cursor is not shown by default. I think the 'lcd.cursor()' command is used to turn it on.

Don

I rewired, and recoded my sketch to the LCD Library tutorial on the Arduino site. It still prints the weird symbols, and sometimes doesn't print or show the cursor at all.

Code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sencePin = 0;
int switchPin = 8;
int ledPin = 6;
int yellowPin = 7;
boolean lastButton = LOW;
boolean currentButton = LOW;
int ledLevel;
int val;
boolean on = false;

void setup()
{
  Serial.begin(9600);
  pinMode(switchPin, INPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(yellowPin, OUTPUT);
  lcd.begin(16, 2);   
  lcd.clear();
  lcd.cursor();
}

boolean debounce(boolean last)
{
  boolean current = digitalRead(switchPin);
  if (last != current)
  {
    delay(5);
    current = digitalRead(switchPin);
  }
  return current;
}

void readLight()
{
   Serial.println(analogRead(sencePin));
   delay(1000);
}

void loop()
{ 
  int yPin = digitalRead(yellowPin);
  int sPin = digitalRead(switchPin);
  val = analogRead(sencePin);
  val = constrain(val, 250, 800);
  ledLevel = map(val, 250, 800, 255, 0);
  currentButton = debounce(lastButton);
  
  if (currentButton == HIGH && lastButton == LOW)
  {
      on = !on;
  } 
  
  if (yPin == HIGH)
  {
   lcd.print("Works!");
  }
  
  if (on == true)
  {
    lcd.display();
    lcd.clear();
    digitalWrite(ledPin, HIGH);
    analogWrite(yellowPin, ledLevel);
  } else if (on == false) {
    lcd.noDisplay();
    digitalWrite(ledPin, LOW);
    digitalWrite(yellowPin, LOW);
  }
  lastButton = currentButton;
}

I added some buttons, LEDs, and a light sensor.

How good is your soldering on the female connector? Can you take a picture of the under side of the lcd to show the soldering job?

What happens when you run Floresta's code in reply #5?

liudr:
How good is your soldering on the female connector? Can you take a picture of the under side of the lcd to show the soldering job?

I'll upload one soon.

JoeO:
What happens when you run Floresta's code in reply #5?

It just shows the symbols.

Ciehanski:
Forget that. But the cursor doesn't show. But the symbols do.

My mistake, I meant lcd.setCursor(...) - I wanted to see whether cursor positioning worked.

dc42:

Ciehanski:
Forget that. But the cursor doesn't show. But the symbols do.

My mistake, I meant lcd.setCursor(...) - I wanted to see whether cursor positioning worked.

Even in the hello world tutorial, the cursor, nor the text shows. I even re-soldered the header pins. I have no idea what's wrong.

Here is my solder job: http://troll.ws/i/Kd8Gei.jpg

Quote from: JoeO on December 10, 2011, 11:01:32 PM
What happens when you run Floresta's code in reply #5?

It just shows the symbols.

Come on, give us some help here....
Does it always show the same three symbols?
Are they always in the same position?
Are there symbols on both lines?

Don

floresta:

Quote from: JoeO on December 10, 2011, 11:01:32 PM
What happens when you run Floresta's code in reply #5?

It just shows the symbols.

Come on, give us some help here....
Does it always show the same three symbols?
Are they always in the same position?
Are there symbols on both lines?

Don

No, different symbols. Different positions depending on the words being printed. They only appear on the first line.

Ciehanski:
Here is my solder job: http://troll.ws/i/Kd8Gei.jpg

Not very good. Your soldering iron is too cold. Your pins 1,6, and 11 are the worst. You should re-head the pins so the solder can melt and be sucked into the holes. You have made some basic mistakes possibly melting the solder on the iron instead of on the part to be soldered together. The only trick you need to know is to NOT touch the solder with the iron.

Your picture is out of focus. To you, does the solder look like kisses?

Only cold solder looks like above. Solution is to re-heat.

No, different symbols. Different positions depending on the words being printed.

The word being printed don't change, they are 'hello, world!' and 'it works!' so what do you mean by "depending on the words being printed"?

Here's another diagnostic sketch to run, you can leave the lcd.begin(20,4) it won't affect the results when run on a 16x2 .

...
void setup()
  {
    lcd.begin(20, 4);
    for (int i=47; i<127; i++)                 // send 80 consecutive displayable characters to the LCD
    {
    lcd.print(i,BYTE);
    delay(100);                                // this delay allows you to observe the addressing sequence
    }
  }
void loop()
  {  
  }

Don

Only cold solder looks like above. Solution is to re-heat.

You could hold the board upside down while you are reheating to try and get rid of the excess solder as well.

Don

Ohhh. Well, I am new to all this. So I should re-solder? Should I get rid of the old header pins, and get new ones? Or just reheat?

My NEW solder job.
http://troll.ws/i/mXeus0.jpg

None of the connections are touching, and they are fully secured with solder.