Use the hardware PwmOut to pulsate an LED (or something else), with selectable active high/low, customisable intensity function, gamma correction, and number of brightness levels.
Diff: Pulsator.cpp
- Revision:
- 2:e351afc2a3a8
- Parent:
- 1:bcddb9898625
- Child:
- 3:a789d816b3a2
--- a/Pulsator.cpp Fri Apr 24 05:14:06 2015 +0000 +++ b/Pulsator.cpp Fri Apr 24 05:20:38 2015 +0000 @@ -71,9 +71,11 @@ } /*! Create a \a Pulsator object. - * \param pin Pin to pulsate. Some platforms can only drive certain pins with the hardware PWM. + * \param pin Pin to pulsate. Note that some platforms can only + * drive certain pins with the hardware PWM. * \param period Duration of each cycle, in seconds. - * \param active_high Should the output pin be active high (\a true), or active low (\a false)? + * \param active_high Should the output pin be active high (\a true), + * or active low (\a false)? * \param gamma Gamma correction for the output LED. * \param levels Number of distinct brightness levels: a minimum of 2. */ @@ -85,7 +87,10 @@ /*! Enable or disable the output. - * \param state Pulsate the output? Passing \a false deactivates the output. + * \param state Pulsate the output? + * \note Passing \a false deactivates the output completely, rather than + * keeping the LED brightness at the point where this is called. + * Conversely, \a true starts pulsating from the inactive state. */ Pulsator& Pulsator::operator=(bool state) {