(you are viewing a thread; or go back to
list of threads)
pwm analog input (by john devito)
need some help with a project what im trying to do is vary the brightness of a led im using a light to voltage converter 0-5volt an a led driver that uses pwm input im trying to make led dim in dark condition a bright in sunny condition
light to voltage is a TSL261RD-TR
led driver is a CAT4104V-GT3
and a PIC 16F886
the example works but backwards!in the dark led is bright in sun led is dim LOL help with rewrite please thanx
(no subject) (by MGP)
Maybe if you work like this:
AALS
Value = 1023 - AALS
And then the rest of your program.
BTW you have forgotten a rung in your program, reading the analog input AALS
(no subject) (by john devito)
like this ?
(no subject) (by MGP)
Is this good for the job?
I think you are using an older version of LDmicro because I get a warning when saving the program.
But it should work.
(no subject) (by john devito)
THANX MGP seems to be working i dont understand all this math part
(no subject) (by MGP)
Here you have your program with more explanation about mathematics.
(no subject) (by MGP)
Here a shorter program that does the same with the use of the 10 bits PWM from LDmicro 4.3.8
(no subject) (by Teresa)
Hello friends pwmexmpl_PWM1023 does not work sketch arduino which can be the problem.
Thank you.
(no subject) (by MGP)
Teresa, I just simulated it as an example.
I see that you want to PWM at 61Hz and I think that does not work, because the crystal frequency of the controller is too high and that's why you have to choose a higher frequency.
But I dont work with Arduino...
(no subject) (by Teresa)
With this program the hex file if it works pwm.
But it does not work with sketch arduino.
Thank you.
(no subject) (by MGP)
Ok, then it's for IHOR ;)
(no subject) (by Teresa)
Many thanks MGP.
(no subject) (by john devito)
thanx again MGP i like the simple one but i have encountered a problem as the output of the als gets low the led turns of like it should but i would like to keep it on dim even in no light condition i tried to put a voltage divider circuit in parallel with the out put of the als but it still dims untill it goes out
bidirctional dc motor (by smei)
how to dc motor speed control with techo forward &reverse..
0 to 10v analog input and. 0.24v techo...and closed loop control..any example program
(no subject) (by MGP)
@John Devito, is this better?
@SMEI, use an other H-bridge, you can only use it with 5V motors
por smei (by Calubert)
El puente en H usa solo 2 salidas No hace falta usar 4 salidas,
si usas 4 salidas veras que la velocidades de ejecutante no serán = por ello usa 2 salidas y tendrás mas memoria sin desperdiciar y sera mas efectivo el puente H.
ADC range (by Dacman)
Hi,
in your example pwmexmpl_v2_with comment.ld,
would it be possible to modify to obtain a 0-100% PWM with an ADC value between 0.2V and 4.9V ?
Thank you,
Jose
Post a reply to this comment:
|