FRDM-K22F AtoD Value passed to PWM

cancel
Showing results for 
Search instead for 
Did you mean: 

FRDM-K22F AtoD Value passed to PWM

234 Views
briancavanagh
Contributor III

Hi All,

I wrote a program that will take an AtoD measurement that I would like to pass to the PWM to set the duty cycle.

Can someone look at my code (very small) and let me know where I'm going wrong?  Note:  I removed my LED code so it's not so large to read.

Thanks,

Brian

pastedImage_1.png

0 Kudos
2 Replies

104 Views
briancavanagh
Contributor III

Hi All,

I found the solution to my problem.  I wasn't including AD0_Start();  in my program (see below).

What I left out in my description above was I'm using a Potentiometer that's connected to the AtoD pin.

Now when I adjust the pot the PWM changes as well.

Thanks,

Brian

pastedImage_1.png

0 Kudos

104 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Brian,

Thanks for your sharing .

BR

Alice

0 Kudos