Skip to content

Commit

Permalink
Fix setPixel with WS2811_GBR WS2811_BRG WS2811_BGR modes
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Jul 3, 2017
1 parent 853f13d commit 225babc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OctoWS2811.cpp
Expand Up @@ -385,8 +385,14 @@ void OctoWS2811::setPixel(uint32_t num, int color)
color = ((color<<8)&0xFF0000) | ((color>>8)&0x00FF00) | (color&0x0000FF);
break;
case WS2811_GBR:
color = ((color<<16)&0xFF0000) | ((color>>8)&0x00FFFF);
break;
case WS2811_BRG:
color = ((color<<8)&0xFFFF00) | ((color>>16)&0x0000FF);
break;
case WS2811_BGR:
color = ((color<<16)&0xFF0000) | (color&0x00FF00) | ((color>>16)&0x0000FF);
break;
default:
break;
}
Expand Down

0 comments on commit 225babc

Please sign in to comment.