Arduino-PWM generator code

LesJones

Joined Jan 8, 2017
4,511
PWM normally has a fixed frequency but it can't have a fixed duty cycle. I can't help with the code as I am useless at writing in "C" (I work with assembler.)

Les.
 

Ian Rogers

Joined Dec 12, 2012
1,136
A pwm with a fixed duty and fixed frequency is just a pulse frequency!!

From you wording!! Are you changing a 2~4v signal into a PWM?
 

Ian Rogers

Joined Dec 12, 2012
1,136
I see... You have an unstable voltage 2~4v and you need the arduino to stabilise an output voltage at a certain voltage?

You do realise you can actually buy these for pennies... A boost convertor made from arduino is a bit overkill!!
 

shteii01

Joined Feb 19, 2010
4,644
The only thing clear is that Arduino board will be sensing voltage between 2 and 4 volts.

You say output of the board is pwm. Then you start talking about adjusting frequency and duty cycle of pwm, and you looose me at this point since you do not clearly state what you want:
- adjust frequency of pwm
- adjust duty cycle of pwm
- adjust both

And now you started talking about leds.

So. No. It is not clear.
 
Top