eBoard ๐Ÿ‰  โ‘ โ‘งโ‘จ
Written for SIA 2017/2018
eagle_Comfort.h
Go to the documentation of this file.
1 #ifndef EAGLE_EBOARD_HELPLIB_COMFORT
2 #define EAGLE_EBOARD_HELPLIB_COMFORT
3 
8  inline int sine8(uint8_t val);
10  inline int sine8(uint8_t val){
11  return int((__builtin_sin((val/128.0*PI))+1)*127.5+0.5);
12  }
14 
19  inline int gamma8(uint8_t val);
21  inline int gamma8(uint8_t val){
22  return int(pow((val)/255.0,2.6)*255.0+0.5);
23  }
25 #endif
int sine8(uint8_t val)
will return the mapped 8-bit sin you can use in e.g. NeoPixel
int gamma8(uint8_t val)
will return the mapped 8-bit gamma correction you can use in e.g. NeoPixel