Heey,
Im quite new to arduino and still learning alot every time,
And at the moment i have a sort of idea in my head that i can't get working...
I wanna make something like a boot-up screen on my lcd when its turned on.
And what i mean by that is for example : Boot-up : " and then a counter that goes from 1 to 100%"
( like 1% 2% 3%.... ) but i want him to override the last digit, so the 1 disappears and the 2 appears if u know what i mean lol.
I do know i can write a HUGE piece of code for that but i was wondering if there is a easy way to achieve this idea ?
I hope one of u can help me with this problem!
Thnx
OK let's start with what LCD are you using? That will decide what code we may suggest. Please post where you got your LCD and the specification sheet if you have one.
In general, if you move the cursor back to a fixed location every time you write a number, your new number will overwrite the old.
Now i do get ur point about the fixed position so it can override the previous number, and thats exactly what i meant.
But I'm stil a bit unsure about how to achieve that result...
Maybe u have some info about it of something like a sample idea from what i can work from ?
It looks like the standard LCD interface. The library included with the Arduino IDE should work.
Here is a sample code that might be what you're after:
/*
LiquidCrystal Library - Hello World With Loading Screen
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.setCursor(0,0); //set cursor to top left corner
lcd.print("Booting:"); //print the text to the lcd
for (int i = 0; i <= 100; i++){ // you can change the increment value here
lcd.setCursor(8,0);
if (i<100) lcd.print(" "); //print a space if the percentage is < 100
if (i<10) lcd.print(" "); //print a space if the percentage is < 10
lcd.print(i);
lcd.print("%");
delay(100); //change the delay to change how fast the boot up screen changes
}
lcd.setCursor(0,0);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}
for (int i = 0; i <= 100; i++){ // you can change the increment value here
lcd.setCursor(8,0);
if (i<100) lcd.print(" "); //print a space if the percentage is < 100
if (i<10) lcd.print(" "); //print a space if the percentage is < 10
lcd.print(i);
lcd.print("%");
delay(100); //change the delay to change how fast the boot up screen changes
}
That was exactly the part i was struggling with, i did knew it would look something like that but not exactly how.
This is great, u guys helped me alot, first of all i got the code and second of all now i see how the code works.
Thank for the example!
I'm glad John_S was around this afternoon to write you code. I was on a different coding activity and was tied up till about now
Stick around and pay attention to others asking questions. Sometimes reading through another person's questions and answers inspires you with ideas too.