Pages: 1 [2] 3   Go Down
Author Topic: 16x2 LCD prints foreign letters?  (Read 2053 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

New pictures are up. smiley
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The LCD Pins:
1 - To ground.
2 - To 5v
3 - To pot.
4 - To Arduino pin 7.
5 - To ground.
6 - To Arduino pin 8.
11 - To Arduino pin 9.
12 - To Arduino pin 10.
13 - To Arduino pin 11.
14 - To Arduino pin 12.
15 - To 5v.
16 - To ground.

The ones I skipped are not connected to anything. From that, is my wiring and LCD variable in the code all correct?

That wiring does correspond to the LCD constructor call in the code you posted.

Try a sketch that does the begin call, then sets the cursor position and prints a single character, or 4 characters all the same. Experiment with different cursor positions and characters. From the results you get, we may be able to establish where the problem lies.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The LCD Pins:
1 - To ground.
2 - To 5v
3 - To pot.
4 - To Arduino pin 7.
5 - To ground.
6 - To Arduino pin 8.
11 - To Arduino pin 9.
12 - To Arduino pin 10.
13 - To Arduino pin 11.
14 - To Arduino pin 12.
15 - To 5v.
16 - To ground.

The ones I skipped are not connected to anything. From that, is my wiring and LCD variable in the code all correct?

That wiring does correspond to the LCD constructor call in the code you posted.

Try a sketch that does the begin call, then sets the cursor position and prints a single character, or 4 characters all the same. Experiment with different cursor positions and characters. From the results you get, we may be able to establish where the problem lies.

When I do the lcd.cursor(); it doesn't show it at all, but when uploading to the board it shows up, not at the beginning of the line, but about 4 spaces away from the end, and then when uploading is done, it disappears.

Also, when I do lcd.print("Test"); it doesn't even show the weird symbols anymore. My lcd variable code must not be in order.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Ciehanski
You really should not use the Quote button with orange text at the upper right of a previous reply unless you really intend to quote the full text of that particular reply.  If that is not the case then you should use the Reply button with black text that is under the last reply.

Don
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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:
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.
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 64
Posts: 6893
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged


Upstate NY
Offline Offline
Full Member
***
Karma: 2
Posts: 183
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

What happens when you run Floresta's code in reply #5?
It just shows the symbols.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
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.
Logged

Pages: 1 [2] 3   Go Up
Jump to: