Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduino Plus 2 RGB LED PWM Sample


  • Please log in to reply
5 replies to this topic

#1 tim c

tim c

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 24 November 2012 - 06:26 PM

This all started because I have this kit: http://www.seeedstud....html?cPath=138

And I wanted to get this sample working: http://www.seeedstud...k:_Tricolor_LED

I used a few pieces of code to compile this sample. Thanks goes out to everyone working on educating folks on how to work with all this.

http://forums.netdui...torial-rgb-led/

http://netmftoolbox.codeplex.com/

http://forums.netdui...etduino-plus-2/

I do NOT know electronics so please feel free to point out any issues you see.

NOTE change the last parm from true to false if you are using a cathode type RGB LED and connect
the cathode to the ground. I have not tested that as I only have an Anode LED.
http://en.wikipedia.org/wiki/Cathode
http://en.wikipedia.org/wiki/Anodic

led_r = new PWM(PWMChannels.PWM_PIN_D9, 100u, 0u, PWM.ScaleFactor.Microseconds, true);

Attached Files



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 November 2012 - 06:33 PM

Hi Tim, Thanks for sharing this! BTW, it should work with Netduino Plus 1 as well...since pin D9 has PWM on the original board too. Welcome to the Netduino community, Chris

#3 hijase

hijase

    New Member

  • Members
  • Pip
  • 3 posts

Posted 11 February 2014 - 02:59 AM

Thanks for the post Tim, I used this sample to get going with mine ;)

 

one thing I noticed, the common pin on the RGB LED in the diagram goes to 3.3v - in my case I routed it to ground to get it to work. so I'm not 100% sure that the diagram is correct.

 

cheers



#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 February 2014 - 04:13 AM

Hi hijase, Just FYI...tim's RGB LED was common anode (which means that all three LEDs share a power pin) and yours is probably common cathode (which means that all three LEDs share a ground pin). You may also want change the invert parameter of the PWM constructor to false--or your colors may be inverted :) Welcome to the Netduino community! Chris

#5 hijase

hijase

    New Member

  • Members
  • Pip
  • 3 posts

Posted 11 February 2014 - 04:35 PM

Aaah, that makes sense, thanks for the explanation Chris, much appreciated :)



#6 hijase

hijase

    New Member

  • Members
  • Pip
  • 3 posts

Posted 13 February 2014 - 04:57 AM

And yes, I did need to invert to false to get the colours right :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.