This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

setting up pwm for LED SDK 11

Hi, im trying to set up 3 PWMs for simulating a RGB LED with the 3 leds on the nrf52-dk. I need the following behavior:

pushing on a button increases the width of the period -> led gets brighter.

How do i set up a simple pwm where i can set the pulse width. I should work with S132 and SDK 11. This one would be perfect: github.com/.../nrf51-pwm-library

but i cant get it up and running with SDK11.

Parents
  • Push button is active low, assuming you have set up the interrupt for button push event, you just need to set PWM to different duty cycle in order to get different brightness.

    Do you need individual control over each of the three channels? I would suggest looking at examples/peripheral/low_power_pwm in your SDK folder if you are not required to implement PWM with high precision. Otherwise please look into examples/peripheral/pwm_library for an example. The difference between the two is the first one uses low_power_pwm module in components/libraries/low_power_pwm, the second one uses app_pwm in components/libraries/pwm

Reply
  • Push button is active low, assuming you have set up the interrupt for button push event, you just need to set PWM to different duty cycle in order to get different brightness.

    Do you need individual control over each of the three channels? I would suggest looking at examples/peripheral/low_power_pwm in your SDK folder if you are not required to implement PWM with high precision. Otherwise please look into examples/peripheral/pwm_library for an example. The difference between the two is the first one uses low_power_pwm module in components/libraries/low_power_pwm, the second one uses app_pwm in components/libraries/pwm

Children
No Data
Related