mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-07 04:44:26 +02:00
Normalize API doc styling
@@ -15,36 +15,36 @@ Return true if there is at least one active running animation.
|
|||||||
|
|
||||||
## bool NextAvailableAnimation(uint16_t* indexAvailable, uint16_t indexStart = 0)
|
## bool NextAvailableAnimation(uint16_t* indexAvailable, uint16_t indexStart = 0)
|
||||||
Return true if there is an available animation channel, and set the given indexAvailable variable to the channel index.
|
Return true if there is an available animation channel, and set the given indexAvailable variable to the channel index.
|
||||||
> * indexAvailable - a pointer to the variable to return the available channel index
|
> * _indexAvailable_ - a pointer to the variable to return the available channel index
|
||||||
> * indexStart - the index to start searching at
|
> * _indexStart_ - the index to start searching at
|
||||||
|
|
||||||
## void StartAnimation(uint16_t indexAnimation, uint16_t duration, AnimUpdateCallback animUpdate)
|
## void StartAnimation(uint16_t indexAnimation, uint16_t duration, AnimUpdateCallback animUpdate)
|
||||||
Start an animation at the given index, set the length in time to duration, and provide a update callback that apply the effect.
|
Start an animation at the given index, set the length in time to duration, and provide a update callback that apply the effect.
|
||||||
> * indexAnimation - the animation channel to use. If there is an active animation on that channel, it will be stopped first and then the channel will be reused.
|
> * _indexAnimation_ - the animation channel to use. If there is an active animation on that channel, it will be stopped first and then the channel will be reused.
|
||||||
> * duration - the length of time the animation will run. The scale is based on the flags passed to the constructor of this manager class.
|
> * _duration_ - the length of time the animation will run. The scale is based on the flags passed to the constructor of this manager class.
|
||||||
> * animUpdate - the callback function that will be called for every passage of time.
|
> * _animUpdate_ - the callback function that will be called for every passage of time.
|
||||||
|
|
||||||
## void StopAnimation(uint16_t indexAnimation)
|
## void StopAnimation(uint16_t indexAnimation)
|
||||||
Stop the animation on the given channel.
|
Stop the animation on the given channel.
|
||||||
> * indexAnimation - the animation channel to stop.
|
> * _indexAnimation_ - the animation channel to stop.
|
||||||
|
|
||||||
## void RestartAnimation(uint16_t indexAnimation)
|
## void RestartAnimation(uint16_t indexAnimation)
|
||||||
Without changing any of the parameters of the animation, restart the animation. If the animation was running it will jump to the beginning and then progress from the start.
|
Without changing any of the parameters of the animation, restart the animation. If the animation was running it will jump to the beginning and then progress from the start.
|
||||||
This provides an easy way to loop an animation if needed.
|
This provides an easy way to loop an animation if needed.
|
||||||
> * indexAnimation - the animation channel to restart.
|
> * _indexAnimation_ - the animation channel to restart.
|
||||||
|
|
||||||
## bool IsAnimationActive(uint16_t indexAnimation)
|
## bool IsAnimationActive(uint16_t indexAnimation)
|
||||||
Return true if the specified animation channel is running.
|
Return true if the specified animation channel is running.
|
||||||
> * indexAnimation - the animation channel to check
|
> * _indexAnimation_ - the animation channel to check
|
||||||
|
|
||||||
## uint16_t AnimationDuration(uint16_t indexAnimation)
|
## uint16_t AnimationDuration(uint16_t indexAnimation)
|
||||||
Return the duration of the specified animation channel. The time is based on the flags passed to the constructor of this manager class.
|
Return the duration of the specified animation channel. The time is based on the flags passed to the constructor of this manager class.
|
||||||
> * indexAnimation - the animation channel to retrieve from.
|
> * _indexAnimation_ - the animation channel to retrieve from.
|
||||||
|
|
||||||
## void ChangeAnimationDuration(uint16_t indexAnimation, uint16_t newDuration);
|
## void ChangeAnimationDuration(uint16_t indexAnimation, uint16_t newDuration);
|
||||||
Called to change the duration that a single animation takes to execute. If the animation was running it will NOT jump to the beginning.
|
Called to change the duration that a single animation takes to execute. If the animation was running it will NOT jump to the beginning.
|
||||||
> * indexAnimation - the animation channel to retrieve from.
|
> * _indexAnimation_ - the animation channel to retrieve from.
|
||||||
> * newDuration - the length of time the animation will run. The scale is based on the flags passed to the constructor of this manager class.
|
> * _newDuration_ - the length of time the animation will run. The scale is based on the flags passed to the constructor of this manager class.
|
||||||
|
|
||||||
## void UpdateAnimations()
|
## void UpdateAnimations()
|
||||||
Called to allow the animations to progress in time. This must be called periodically in the Loop(). Best if called at least once every 10ms but can be called as fast as the loop() runs.
|
Called to allow the animations to progress in time. This must be called periodically in the Loop(). Best if called at least once every 10ms but can be called as fast as the loop() runs.
|
||||||
@@ -63,14 +63,17 @@ Return the current time scale.
|
|||||||
|
|
||||||
## void setTimeScale(uint16_t timeScale)
|
## void setTimeScale(uint16_t timeScale)
|
||||||
Set the current time scale. All currently running animations will be effected by this change, either slowing them down or speeding them up.
|
Set the current time scale. All currently running animations will be effected by this change, either slowing them down or speeding them up.
|
||||||
> * timeScale - See values explained in the constructor
|
> * _timeScale_ - See values explained in the constructor
|
||||||
|
|
||||||
# Structs
|
# Structs
|
||||||
## AnimationParam
|
## AnimationParam
|
||||||
This struct contains three properties that provide state information to the animation callback.
|
This struct contains three properties that provide state information to the animation callback.
|
||||||
float progress - the progress from 0.0 to 1.0 of the animation to apply
|
> * float _progress_ - the progress from 0.0 to 1.0 of the animation to apply
|
||||||
uint16_t index - the channel index of the animation
|
> * uint16_t _index_ - the channel index of the animation
|
||||||
AnimationState state - the animation state, which can be one of the following...
|
> * AnimationState _state_ - the animation state, which can be one of the following...
|
||||||
- AnimationState_Started - this is the first call to update, will only be set once unless the animation is restarted.
|
> >
|
||||||
- AnimationState_Progress - this is one of the many calls between the first and last.
|
```
|
||||||
- AnimationState_Completed - this is the last call to update, will only be set once unless the animation is restarted
|
AnimationState_Started - this is the first call to update, will only be set once unless the animation is restarted.
|
||||||
|
AnimationState_Progress - this is one of the many calls between the first and last.
|
||||||
|
AnimationState_Completed - this is the last call to update, will only be set once unless the animation is restarted.
|
||||||
|
```
|
Reference in New Issue
Block a user