LCD Code

Hi, this is my first time on the form

So I have An Arduino r3 on an LCD keypad shield. I have the top line of the 2x16 character LCD
Is the temp and humidity from the dht11 and on the bottom line I would like to have a scroll feature on this text= Baileys Electronics Shed = I hope someone can add this into the code for me. If this is not clear I can make it easy to understand if need be.

If you are wondering this is for my 3D printer. It will tell me the temp and humidity via the lcd.

Thanks, Heaps

Bailey

WeatherStation1.zip (619 Bytes)

The forum is not a code writing service. We’ll help you write your own so you learn in the process. Attaching a zip file is also frowned upon, the forum has a simple way to post your code safely and if you think someone is going to download your zip file and open it, well, dream on.

Please read the forum rules for how and what to post, they’re a sticky at the top of every category titled “how to use this forum - please read”.

Check out the rules and edit your post to get help.

There are plenty of scrolling text examples around see Mr Google .

There is a special command for this in the library. Leo..

well, ok..... Can any of you Help me write the code?I am just lost case when i try to add in the scroll feature it says "

`********** was not declared in this scope

Can you pls help me?

Baileys_Electronics_Shed123: well, ok..... Can any of you Help me write the code?I am just lost case when i try to add in the scroll feature it says "

`********** was not declared in this scope

Can you pls help me?

If you post your code where I can see it (ie. not as a zip) then I'll help you figure out what's wrong and get it right. But I can't do that as long as you don't post the code where I can see it. Read the "How to use this forum - please read" post for more information on how to post code.

Here it is. do you want it in text?

WeatherStation1.ino (1006 Bytes)

Please read the “How to use this forum” post and follow the instructions.

Post the code using code tags ("</>" button).

Wait, Cant I just copy and paste the scroll feature in the dht11 code? That could save you the trouble.

(btw im 13)

Baileys_Electronics_Shed123:
(btw im 13)

That’s more than old enough to read the instructions before you start. That will save you TONS of trouble throughout your life.

    /////////////////////////////////////////////////////////////////
   //            Arduino Weather Station #1             v1.02     //
  //       Get the latest version of the code here:              //
 //         http://educ8s.tv/arduino-weather-station-1/         //
/////////////////////////////////////////////////////////////////


#include "DHT.h"
#include <LiquidCrystal.h>


#define DHTPIN 22     // what pin we're connected to

#define DHTTYPE DHT11   

DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(8,9,4,5,6,7); 

void setup(void) {
  lcd.begin(16, 2);
  lcd.print("Reading sensor");
  dht.begin();
}

void loop() {
  
  float temperature, humidity;

  humidity = dht.readHumidity();
  temperature = dht.readTemperature();
  delay(2000); 

 lcd.clear();

 char tempF[6]; 
 char humF[6];
 dtostrf(temperature, 5, 1, tempF);
 dtostrf(humidity, 2, 0, humF);

 lcd.print("T:"); 
 lcd.print(tempF);
 lcd.print((char)223);
 lcd.print("C ");
 lcd.print("H: ");
 lcd.print(humF);
 lcd.print("%");
}

Baileys_Electronics_Shed123: well, ok..... Can any of you Help me write the code?I am just lost case when i try to add in the scroll feature it says "

`********** was not declared in this scope

Now lets get the actual error message. I promise it didn't say ******* was not declared. It told you exactly what line and where in the code it found the problem and it said exactly what identifier you tried to use that didn't exist in your code.

13 or not, this is not coding stuff. Things like, tell the guy you want to help correct the error what the actual freaking error is, is just plain common-horse-sense.

And that is why everyone hates me:(

Baileys_Electronics_Shed123: And that is why everyone hates me:(

What? Get over yourself kid. Nobody hates you. We're just kicking you a little and trying to get you to pay attention. Now you're off on your little feelings. If you want to talk feelings then Dr. Phil has a great forum for that. If you want to talk about code then you're in the right place.

FTR: I was cool with you. I didn't lose respect for you until :

Baileys_Electronics_Shed123: And that is why everyone hates me:(

Now, can you teach me how to merge the to codes. The auto scroll example and the dht11 temp and humidity?

Baileys_Electronics_Shed123: Now, can you teach me how to merge the to codes. The auto scroll example and the dht11 temp and humidity?

Teach you how? Sure, show us your best attempt and we will help you learn what you need to learn to get it right.

Want someone to just write it for you? That costs money and happens on the Gigs and Collaborations board.

ok will do

Ok, I have tried my best to merge them. How do I get the auto scroll to be on the bottom line of the 2x16 lcd. Btw it’s a lcd shied

Autoscroll.ino (1.16 KB)

Last time I’m posting your code for you. If you can’t be bothered to read the “How to use this forum” post then why should anyone be bothered to help you?

    /////////////////////////////////////////////////////////////////
   //            Arduino Weather Station #1             v1.02     //
  //       Get the latest version of the code here:              //
 //         http://educ8s.tv/arduino-weather-station-1/         //
/////////////////////////////////////////////////////////////////


#include "DHT.h"
#include <LiquidCrystal.h>


#define DHTPIN 22     // what pin we're connected to

#define DHTTYPE DHT11   

DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(8,9,4,5,6,7); 

void setup(void) {
  lcd.begin(16, 2);
  lcd.print("Reading sensor");
  dht.begin();
 }

void loop() {
    
  lcd.setCursor(0, 0);
  // print from 0 to 9:
  for (int thisChar = 0; thisChar < 10; thisChar++) {
   lcd.print(Baileys Electronics Shed);
   delay(500);
  
  float temperature, humidity;

  humidity = dht.readHumidity();
  temperature = dht.readTemperature();
  delay(2000); 

 lcd.clear();
 lcd.noautoscroll();
 char tempF[6]; 
 char humF[6];
 dtostrf(temperature, 5, 1, tempF);
 dtostrf(humidity, 2, 0, humF);

 lcd.print("T:"); 
 lcd.print(tempF);
 lcd.print((char)223);
 lcd.print("C ");
 lcd.print("H: ");
 lcd.print(humF);
 lcd.print("%");
}
for (int thisChar = 0; thisChar < 10; thisChar++) {

Where does this for loop end? Your code doesn’t compile.

Have you seen this:

https://www.arduino.cc/en/Tutorial/LiquidCrystalScroll

Now keep in mind that they're using a for loop for demonstration purposes to show you how the scroll function works. Probably isn't a good idea to use a blocking for loop in your code. Don't just blindly copy this. Learn what that function does.