I have a potentiometer connected to uC input and I have a LED connnected to it's output. Now what I want is as I change the POT the LED on/off should vary. In other words if the POT's wiper is in the middle the LED on/off should be at 1s and when the POT is on the left side(min) the LED on/off should be 2s and when the POT is on the right side(max) the LED on/off should be 0.25s.
Now this thing can be done without the POT also right. That means if I don't use POT I will have to give constant value in the code or I can use a button to get different values, right. THIS IS WHAT I WANT TO BE DONE USING PWM.
I think I cannot explain better than this.
Seems like you have a hard time explaining to our dumb brains!
And you are trying to do the above using pwm instead of a POT.
Is that correct ??
FIRST I AM NOT LOOKING FOR THE BRIGHTNESS CONTROL. FOR THIS I HAVE ALREADY POSTED THE CODE ABOVE. THE ABOVE CODE IS FOR FADE IN FADE OUT WHICH CAN BE MODIFIED FOR BRIGHTNESS CONTROL.
If you wanted to use the pwm for led on/off control that is visible to human eye(very low switching frequency), it is basically the exact opposite of the primary purpose of pwm(high switching frequency).Regards the freq, what do you think the freq range for various pwm duty cycle should be where we can see the LED on off using PWM where it is visible to human eye.
Thanks
The on and off frequency ( not in Hz, in terms of times) depending on the PWM duty cycle. Like 100% duty cycle the on and off should be for 1s or so and 25% should be for 0.25s etc etc.
Thanks
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?