A simple PWM LED approach for the Thingy:91

I'm trying to drive the RGB LED light on the Thingy:91. So far, I've not been successful. I was hoping that by listing the steps I perform I might be able to get some advice. This is the first time that I've dealt with PWM. Here are the steps I'm presently taking:

1. Using PWM0_NS (my program is insecure), assign pins p0_29, p0_30, and p0_31 having set them up as push/pull output with an initial level of high.
2. Set the period of the PWM to 500hz.
3. I then loop around wanting to toggle the LED on and off by setting the duty of all three channels to the max duty (on) and 0 (off) with about 1 second sleep in between.

Does this approach seem reasonable? I really want the simplest PWM RGB LED demo I can; think of blinky for the RGB LED.

Thanks for any help.

Top Replies

Related