modm API documentation
modm::ui::Strobe< T > Class Template Reference

#include <modm/ui/animation/strobe.hpp>

Public Member Functions

 Strobe (Animation< T > &animator)
 
bool setPeriod (TimeType period, uint8_t dutyCycle1=7, uint8_t dutyCycle2=10, uint8_t dutyCycle3=10)
 
void setFadeTimes (TimeType onFade, TimeType offFade)
 
void setRange (T minValue, T maxValue)
 
void start (uint8_t repeat=0)
 start indicating for ever
 
void stop ()
 Stops indicating after finishing the current cycle.
 
void cancel ()
 
bool isAnimating () const
 
void update ()
 Must be called at least every ms.
 

Detailed Description

template<typename T = uint8_t>
class modm::ui::Strobe< T >

This class provided two smooth on and off phases.

|--------------------------------- period -|
|-- dc1 --||-- dc2 --||-- dc3 --|
_________ _________ ____
_/ \___________/ \___________/ ...
^ onFade ^ offFade ^ onFade ^ offFade
Author
Niklas Hauser

Member Function Documentation

template<typename T = uint8_t>
void modm::ui::Strobe< T >::setFadeTimes ( TimeType  onFade,
TimeType  offFade 
)
inline
Parameters
onFadethe time is takes to turn on in ms
offFadethe time is takes to turn off in ms
template<typename T = uint8_t>
bool modm::ui::Strobe< T >::setPeriod ( TimeType  period,
uint8_t  dutyCycle1 = 7,
uint8_t  dutyCycle2 = 10,
uint8_t  dutyCycle3 = 10 
)
inline
Parameters
periodin ms
dutyCyclein percent <= 100
Returns
true if inputs were correct, false otherwise

The documentation for this class was generated from the following file: