hey
I need help with my project
I need show information from arduino on display but this info must change the daily or when I press the button.
I will be grateful for any help.
Store your texts in an array
char text[][17] =
{
"hello",
"world",
"how",
"is",
"it"
};
The '17' allows a text of 16 characters plus nul terminator.
Next you can use random() every 86400 seconds or when a button is pressed to pick one of the above texts and display it on the lcd.
Okey
I don't understant it
Please could you help me with it ?
Usually I use done projects or combine two in one.
This is first time when I use lcd
I can guide you through it. Start with a simple i2c lcd example and get that working.
Next instead of something like
lcd.print("Hello world");
you can use
lcd.print(text[0]);
which will print hello.
The below will print all messages (5 in total from the above)
void loop()
{
// index into text array
static int index = 0;
// print the text at the given index
lcd.print(text[index]);
// increment the index
index++
// if last text displayed, start from the start
if(index>=5)
{
index = 0;
}
delay(1000);
}
Instead of looping and incrementing the index, look at the examples for random (see earlier link); make sure that the randomly generated index is within the bounds of the array (max value 4 for the above text array)
void loop()
{
// index into text array
static int index = 0;
// print the text at the given index
lcd.clear();
lcd.print(text[index]);
// get a new random index
index = random ...... <-------for you to figure out
delay(1000);
}
Once you have figured it out, you need to change the index when a day has passed or when the button is pressed.
You can use a very long delay but will find out that during that delay the button press will not be detected.
So get rid of the delay by using a millis() based timing; see the blink_without_delay example that comes with the IDE and Demonstration code for several things at the same time
That's it for now.
PS
I don't have an i2c lcd so can't help with the specifics for that.
I want display "text1" today and "text2" tomorrow and "text3" next day etc.
I have this RTC DS1302 and DS3231, but I don't know how can I plug it to this project.
I use UNO.
Okay I know how connected it but how to program?
I need help how use clock and lcd in one program to display what I wants.
Download (if you have not already) an I2C lcd library and take a look at the examples that usually come with them.
Download (if you have not already) a library for the RTC and have a look at the examples that usually come with them.
Play with both till you understand how it works.
Once you're familiar with both, write your sketch that combines parts of the examples.
I have library which works with my i2c lcd and display "hello world"
I want create Birthday present for my girlfriend. She made me a jar with little paper where she wrote why she loves me and she made them 365 (on all year)
I want do the same thing but on the arduino.
Store the texts in offboard memory (FRAM, EEPROM) or SD card. Then messages can be longer and even scroll across a screen.