Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
918 Views

Edison + ws2812 RGB LEDs: Output Specific Frequency

I'm using the Edison to control a project, and want to use the ws2812 LEDs. They need a signal that is precisely 800kbps. How do I output a signal at that specific frequency? Specifically, I'm communicating with the Edison via Putty, if that makes a difference.

6 Replies
Highlighted
Community Manager
8 Views

Hi Ghonth,

 

 

Thank you for contacting us.

 

 

One approach to achieve a desired frequency is using the MRAA library. Specifically, the PWM class has some functions that might help you get the 800kbps you need. Some of the most useful resources we found are these ones:

 

https://iotdk.intel.com/docs/master/mraa/classmraa_1_1_pwm.html https://iotdk.intel.com/docs/master/mraa/classmraa_1_1_pwm.html

 

http://www.i-programmer.info/programming/hardware/8777-exploring-edison-pwm.html http://www.i-programmer.info/programming/hardware/8777-exploring-edison-pwm.html

 

 

Also, I looked for examples on how to use the Edison along with the ws2812. I found a few useful guides online, that I think you should see since they provide different approaches. One of the most interesting ones is this: https://www.hackster.io/thingsoc/neoled-neopixels-on-edison-39e91c https://www.hackster.io/thingsoc/neoled-neopixels-on-edison-39e91c

 

 

Let us know if you found this useful.

 

 

-Sergio A

 

0 Kudos
Highlighted
Novice
8 Views

Unfortunately, I need a signal every 1.25 microseconds. The mraa_pwm_period_us command requires an integer, which 1.25 is not.

Using I2C is not an option because we are using it for other things; we can't add another unit to our I2C bus.

0 Kudos
Highlighted
Community Manager
8 Views

As you stated, the period_us function requires an integer, but, there are other options available. Have you considered using the period function which uses an integer?

 

We also thought of another option. Take a look at this example https://github.com/MakersTeam/Edison/blob/master/Arduino-Examples/setPWM_Edison.ino https://github.com/MakersTeam/Edison/blob/master/Arduino-Examples/setPWM_Edison.ino . This is not an MRAA example, it's an Arduino example, but, you can try to set it with the appropriate parameters to see if you're able to achieve the 800kbps you're looking for.

 

 

Let us know your results using these 2 approaches.

 

 

We'll be waiting for your response.

 

-Sergio A

 

0 Kudos
Highlighted
Community Manager
8 Views

Hi Ghonth,

 

 

Do you still need assistance with this thread?

 

We'll be waiting for your response.

 

 

-Sergio A

 

0 Kudos
Highlighted
Novice
8 Views

This specific file worked for my project, even though it was developed for the ws2811 LEDs (RGBW), not the ws2812 LEDs (RGB):

https://github.com/Drunkar/NeoPixel-edison-mraa GitHub - Drunkar/NeoPixel-edison-mraa: NeoPixel library for edison via mraa gpio.

0 Kudos
Highlighted
Community Manager
8 Views

Hi Ghonth,

 

 

Thanks for the confirmation. Feel free to contact us again if help is needed.

 

 

-Sergio A

 

0 Kudos