Go Down

Topic: Backlight control by PWM help (Read 1 time) previous topic - next topic

matiLanza

Hey guys i have a 20x4 LCD which i am matching with a web4robot serial backpack

i want the LCD backlight to be controlled by my pin 3... can anyone help me out here with the code? i can post the code or something maybe you guys can review it and see how to add the backlight control
any volunteers ?  :D

RuggedCircuits

I don't think the code is going to be a big problem -- basically just call analogWrite() with the value that you want.

The bigger question is what hardware you had in mind for interfacing pin 3 with the backlight LED. Here is our suggestion:

http://ruggedcircuits.com/html/circuit__30.html

--
The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

matiLanza

Really? i didnt know controlling the backlight led would require such a circuit

matiLanza

well now i guess i have a diffferent question, as for the pins from the backpack that go into the 16 pins of the LCD.. do i remove the 15 and 16 and wire them for the PWM control from pin 3 or do i leave them in and solder wires of the back or something ? does the backpack need the pins ? im a little confused as why they wouldnt have a backlight pin on the backpack

http://www.web4robot.com/files/SerialLCDCtrl.pdf

sync

http://forums.adafruit.com/viewtopic.php?f=25&t=16478

Code: [Select]
                               LCD Pin 16          +5V
                                |                   |     
                                |                   |     
                       1k      /               LCD Pin 15         
Arduino digital pin -/\/\/\---| npn
                               \
                                |
                                |
                               GND

Go Up