Jump to content
43oh

Changing PWM duty cycle with value from variable


Recommended Posts

Hello, so I have a problem like this. I have a variable which goes from 128-255 and a CCR1 register that goes from 0-255. The question is, How do I change value in CCR1 by two steps for every step in my variable. So 128 is 0 in CCR1, 129 is 2, 130 is 4 etc.

 

I suck at programming so I hope some of you guys can help me out. Thanks

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...