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

Blinking, fading and other useful functions


  • Please log in to reply
2 replies to this topic

#1 djcult

djcult

    New Member

  • Members
  • Pip
  • 3 posts

Posted 16 August 2010 - 06:30 PM

I've written some wrappers around the OutputPort and PWM classes that provide some useful basic functionality. Blinking and fading can be done asyncronously.

Method signatures are:

DiscretePort.TurnOn()
DiscretePort.TurnOff()
DiscretePort.Toggle()
DiscretePort.IsOn
DiscretePort.Blink()
DiscretePort.Blink(int times)
DiscretePort.Blink(int times, bool async)
DiscretePort.Blink(int times, int periodInMilliseconds, bool async)

PwmPort.FadeIn()
PwmPort.FadeIn(int periodInMilliseconds)
PwmPort.FadeIn(int periodInMilliseconds, bool async)
PwmPort.FadeOut()
PwmPort.FadeOut(int periodInMilliseconds)
PwmPort.FadeOut(int periodInMilliseconds, bool async)
PwmPort.FadeInAndOut(int periodInMilliseconds)
PwmPort.FadeInAndOut(int periodInMilliseconds, bool async)

Forgive me if my terminology is all wrong - I'm new to the embedded thing. Code with examples is at here.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 August 2010 - 06:34 PM

Cool! I'll have to play with this... Welcome to the community, djcult, and thanks for sharing your work!

#3 djcult

djcult

    New Member

  • Members
  • Pip
  • 3 posts

Posted 16 August 2010 - 06:36 PM

Oh, I forgot: PwmPort.SetDutyCycle(float percent) !




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.