No problem. Connect another pin to a transistor, and that transistor to the power for your LCD. If you Google "arduino transistor" you'll find a ton of tutorials; here's one:
As far as the potentiometers for brightness / contrast -- most LCDs have pot connections for contrast adjust so you won't need the Arduino there. For brightness you could either connect the pot directly to the LCD's backlight or you could connect the backlight to a PWM pin on your Arduino and adjust it in your program.
But i was wondering if i could just add a button to a digital pin and maybe put some code in that tells the
arduino to close those pins, og stop the output ?
Can you add a button to a digital pin? Yes, that is easy.
Can you put some code in that tells the arduino to close the pins? Yes, but close what pins? Do you mean the pins you use for the LCD? Yes you can turn those off but isn't the LCD power line run directly to the Arduino power?
Thats exactly what i mean, by turning some digital pins off so the lcd wont display anything but the rest of the system runs as usually.
But maybe just add a button to the powerline andthe arduino, would that be easier ?
Thats exactly what i mean, by turning some digital pins off so the lcd wont display anything but the rest of the system runs as usually.
But maybe just add a button to the powerline andthe arduino, would that be easier
?
Best way is to just include the code logic in your sketch to decide if the display should be active and updating or not based on the input state of the added 'shutdown button'.
Is this just to save battery power. If you completely turn the LCD off, you will erase whatever data is on the LCD. To prevent this you want to just turn off the backlight if your particular display allows that (mine doesn't and it sucks).
Take a look at this series of tutorials. I found it to be the best place to start for a new Arduino user: