SHARE
TWEET

Color Wheel Function

ChipSkylarkk Jun 19th, 2013 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uint32_t Wheel(uint16_t WheelPos)
  2. {
  3.   byte r, g, b;
  4.   switch(WheelPos / 128)
  5.   {
  6.     case 0:
  7.       r = 127 - WheelPos % 128;   //Red down
  8.       g = WheelPos % 128;      // Green up
  9.       b = 0;                  //blue off
  10.       break;
  11.     case 1:
  12.       g = 127 - WheelPos % 128;  //green down
  13.       b = WheelPos % 128;      //blue up
  14.       r = 0;                  //red off
  15.       break;
  16.     case 2:
  17.       b = 127 - WheelPos % 128;  //blue down
  18.       r = WheelPos % 128;      //red up
  19.       g = 0;                  //green off
  20.       break;
  21.   }
  22.   return(strip.Color(r,g,b));
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top