Go Down

Topic: LCD1602 problem! (Read 199 times) previous topic - next topic

arduinofreaklol

Oct 24, 2015, 05:28 pm Last Edit: Nov 16, 2015, 02:51 pm by arduinofreaklol
hi!
arduinofreaklol here!

i have a problem with my LCD1602!

i uploaded the code onto my arduino uno R3, and the LCD1602 lit up, but there were no words!

Here's the code:


#include <LiquidCrystal.h>

char array1[]=" FIREPOWER: 10% ";
char array2[]=" FIREPOWER: 20% ";
char array3[]=" FIREPOWER: 30% ";
char array4[]=" FIREPOWER: 40% ";
char array5[]=" FIREPOWER: 50% ";
char array6[]=" FIREPOWER: 60% ";
char array7[]=" FIREPOWER: 70% ";
char array8[]=" FIREPOWER: 80% ";
char array9[]=" FIREPOWER: 90% ";
char array10[]=" FIREPOWER: 100% ";
int tim = 250;

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

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

void loop() {
  lcd.setCursor(15, 0);
  for (int pc1 = 0; pc1 < 26; pc1++) {
    lcd.print(array1[pc1]);
    delay(tim);
  }
}


This code is only a test.

I was going to continue it but i need the test to work!

here is the circuit:




{i don't know if that came up :(}

anyways, i have another problem!

so you saw the code, right?
there were 10 arrays.

how do i get a potentiometer to switch from array1 to array2, and so on?

can you help me?

arduinofreaklol


arduinofreaklol

#1
Oct 24, 2015, 05:43 pm Last Edit: Oct 24, 2015, 06:03 pm by arduinofreaklol
i don't know WHY there is a face instead of an 8!


el_supremo

Read this How to post code properly then edit your message to use code tags

Pete

cattledog

Code: [Select]
void loop() {
  lcd.setCursor(15, 0);
  for (int pc1 = 0; pc1 < 26; pc1++) {
    lcd.print(array1[pc1]);
    delay(tim);
  }
}


Read this article on the lcd controller memory structure http://web.alfredstate.edu/weimandn/lcd/lcd_addressing/lcd_addressing_index.html

You are not printing your data in the visible area.

Why not lcd.setCursor(0,0)? Where do you want your arrays to be? Are you planning to scroll them in to view?

MAS3

You have put your code inside a table tag instead of inside a code tag.
It also looks like you didn't close those tag, certainl;y not at the right spot.

The Fritzing image isn't an image, but a file stored in Fritzing!'s own fileformat.
You can't upload fritzing! files to this board.
Quote
Allowed file types: doc, gif, jpg, mpg, pdf, png, txt, zip, c, h, cpp, ino, pde
So doing this:[img]http://lcd sketch.fzz[/img] will not work for several levels.
lcd sketch.fzz will be some file stored on your PC locally, it is not on the internet.
If it were on the internet, it wouldn't be at that address, because addresses do not have spaces, and the TLD "fzz" isn't available.

So try again, and so will we.
By the way, a topic like this appears every day over here.
Did you have a look at those topics to see if the solution for you is in there already ?
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Vaclav

With exception of  putting a cursor into strange (I mean why ? but I do not need to know) ) position the code  looks OK.
Double check you hardware , some people just "cut and paste" and it is common to have the hardware (pins) wired / assigned wrong.
Just because the backlight  LED works is no grantee the rest of the pins are correct.
When you get that working check out "double dimension array " to use later to switch the text.

And unless you are looking for "printing" effect, you do not need delay to output into LCD.

"Thunder is good, thunder is impressive; but it is lightning that does all the work"
Mark Twain

I do not read nor respond to thunderous posts.

floresta

First things first.  Can you display a simple message such as 'Hello World'?

Don

Paul__B

#7
Oct 25, 2015, 12:07 am Last Edit: Oct 25, 2015, 12:08 am by Paul__B
Again, first things first.

Go and read the instructions, then go back to your first post (do not repeat it) and modify that post to mark up the code as such so we can examine it comfortably and reliably.

While you are at it, you could remove the silly comment from your subject line.


arduinofreaklol

how do i get the lcd text to change when i twist a potentiometer?

MAS3

Connect the potentiometer like the example shows.
Read the value of it.
Send that value to the screen.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy