4 years, 1 month ago.
Problem with PwmOut on a FRDM- KL25Z
I invoke the PWM in the usual way:
PwmOut pwm(PTE30); and the first time I use either of pwm.write(0.5); or pwm = 0.5; I get the correct output of half the supply voltage on pin PTE30. If I use a different argument, I get the appropriate voltage.
But, any future time I use the pwm.write() function or the alternative, the output goes to 0V no matter what value I use for the argument.
I am also using two timers in the program ... Timer tic() etc. The program is attached below
The first time the pwm output is set is in line 159. That value is set correctly and the output is 1.67V. The pwm is again set, once per second, in either lines 115 and 124. In both cases, the output value on pin PTE30 goes to zero Volts.
This is a project in process so te code is a little messy. Sorry
Question relating to:
You need to log in to post a question