Offline
Newbie
Karma: 0
Posts: 8
|
 |
« on: March 06, 2012, 12:09:55 pm » |
Hello There
i was wondering if i were able to add a button to my Arduino Duemilanove on 1 of the Digital pins and make it shutdown some of the others ?
For example im trying to shutdown my lcd, and i want a button to turn it on and off.
and maybe add a potentiometer for the brightness / Contrast.
Any idea ?
Thanks in advance
|
|
|
|
|
Logged
|
|
|
|
|
Southern California
Offline
Sr. Member
Karma: 5
Posts: 466
I like blinky lights
|
 |
« Reply #1 on: March 06, 2012, 12:20:27 pm » |
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: http://art511.wordpress.com/works-in-progress/how-to-use-a-transistor-as-a-switch/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. Good luck!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #2 on: March 06, 2012, 01:50:42 pm » |
Thanks for your quick reply !!
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 ?
|
|
|
|
|
Logged
|
|
|
|
|
Southern California
Offline
Sr. Member
Karma: 5
Posts: 466
I like blinky lights
|
 |
« Reply #3 on: March 06, 2012, 04:41:15 pm » |
Hi, I'm sorry but I don't understand.
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?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #4 on: March 07, 2012, 03:14:11 am » |
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 ?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 20
Arduino rocks
|
 |
« Reply #5 on: March 07, 2012, 03:30:35 am » |
Maybe to conclude : You would like to use button switch to tell Arduino program to turn off LCD display.
You may do that using standard schematic for digital/analogue push button input line and digital to transistor output line.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15314
Measurement changes behavior
|
 |
« Reply #6 on: March 07, 2012, 03:57:41 am » |
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'.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #7 on: March 08, 2012, 02:22:30 am » |
Exactly what meant retrolefty. Maybe you can give an example for it? Because om not that good at coding yet.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 8
|
 |
« Reply #8 on: March 23, 2012, 08:54:29 am » |
No one ?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19017
I don't think you connected the grounds, Dave.
|
 |
« Reply #9 on: March 23, 2012, 09:18:22 am » |
Maybe you can give an example for it? We can't give an example because we don't know what your code looks like.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
WV
Offline
Full Member
Karma: 0
Posts: 160
Arduino, Helps With the ADD
|
 |
« Reply #10 on: March 23, 2012, 12:42:16 pm » |
Wonder if hes asking for something like - if button 1 = high then pin 5 = low(transistor off)?
|
|
|
|
|
Logged
|
|
|
|
|
Cleveland, TN
Offline
Full Member
Karma: 2
Posts: 207
|
 |
« Reply #11 on: March 23, 2012, 06:05:24 pm » |
I don't think he gets the transistor part yet. 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:
|
|
|
|
|
Logged
|
Luck,
Wade
|
|
|
|
WV
Offline
Full Member
Karma: 0
Posts: 160
Arduino, Helps With the ADD
|
 |
« Reply #12 on: March 23, 2012, 07:55:29 pm » |
Wa hoo Mr Blum, Has many Tutorials for the Arduino, its almost a must for the introduction.
|
|
|
|
|
Logged
|
|
|
|
|
|