GyroLights  0.1
Oakleaf
effects.h File Reference

Go to the source code of this file.

Functions

void readGyro (int16_t *rxvalues)
 fill array with values from gyro sensor More...
 
float directedAccelNorm ()
 
float mapfb (float in, float in_min, float in_max, float out_min, float out_max)
 scales a float variable in [in_min, in_max] linearly to [out_min, out_max] More...
 
template<CRGB * targetArray, uint numToFill, uint PERIOD_LENGTH>
void task_rainbow (void *)
 task to apply FastLEDs fill_rainbow to targetArray with changing start hue. More...
 
template<CRGB * targetArray, uint numToFill, uint32_t colorcode>
void task_staticColor (void *)
 task to fill targetArray with a color, then delete task More...
 
template<CRGB * targetArray, uint numToFill>
void task_gyroSimple (void *)
 task maps x,y,z-readings form gyro to r,g,b of targetArray More...
 
template<CRGB * targetArray, uint numToFill, TProgmemRGBGradientPalette_bytes heatmap>
void task_gyroToHeatmap (void *)
 task maps acceleration to heatmap. More...
 
template<CRGB * targetArray, uint numToFill>
void task_effect_jerk_test (void *)
 
template<CRGB * targetArray, uint numToFill>
void task_effect_threashold (void *)
 
template<CRGB * targetArray, uint numToFill>
void task_effect_threashold_exp_decrease (void *)
 

Variables

TaskHandle_t task_local
 

Function Documentation

◆ directedAccelNorm()

float directedAccelNorm ( )
Returns
Norm of the acceleration vector if acceleration in x direction is positive, negative norm oterwise.

◆ mapfb()

float mapfb ( float  in,
float  in_min,
float  in_max,
float  out_min,
float  out_max 
)

scales a float variable in [in_min, in_max] linearly to [out_min, out_max]

Parameters
ininput value
in_mininput lower bound
in_maxinput upper bound
out_minoutput lower bound
out_maxoutput upper bound
Return values
out_minif in <= in_min
out_maxif in >= in_max
Returns
mapped value

◆ readGyro()

void readGyro ( int16_t *  rxvalues)

fill array with values from gyro sensor

Parameters
[out]rxvaluescreate int16_t rxvalues[7] before and pass pointer to it. will be filled with values for accelx, accely accelz, temp, gyrox, gyroy, gyroz

◆ task_effect_jerk_test()

template<CRGB * targetArray, uint numToFill>
void task_effect_jerk_test ( void *  )

◆ task_effect_threashold()

template<CRGB * targetArray, uint numToFill>
void task_effect_threashold ( void *  )

◆ task_effect_threashold_exp_decrease()

template<CRGB * targetArray, uint numToFill>
void task_effect_threashold_exp_decrease ( void *  )

◆ task_gyroSimple()

template<CRGB * targetArray, uint numToFill>
void task_gyroSimple ( void *  )

task maps x,y,z-readings form gyro to r,g,b of targetArray

Template Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array

◆ task_gyroToHeatmap()

template<CRGB * targetArray, uint numToFill, TProgmemRGBGradientPalette_bytes heatmap>
void task_gyroToHeatmap ( void *  )

task maps acceleration to heatmap.

Template Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
heatmapthe color palette to use (has to be created earllier)

◆ task_rainbow()

template<CRGB * targetArray, uint numToFill, uint PERIOD_LENGTH>
void task_rainbow ( void *  )

task to apply FastLEDs fill_rainbow to targetArray with changing start hue.

Template Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
PERIOD_LENGTHin seconds; approx. time, after which the colors repeat.

◆ task_staticColor()

template<CRGB * targetArray, uint numToFill, uint32_t colorcode>
void task_staticColor ( void *  )

task to fill targetArray with a color, then delete task

Template Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
colorcodethe color. Can be of type CRGB (implicit cast)

Variable Documentation

◆ task_local

TaskHandle_t task_local
extern