Offset 1 instead of zero to accomodate for the command byte

Former-commit-id: 1387556d239554f935708f48e7cd2a476ed9b6f5
This commit is contained in:
johan 2013-11-13 23:12:30 +01:00
parent d9a66b3e6d
commit fa1157c3ee

View File

@ -200,9 +200,10 @@ int LedDeviceLightpack::write(const std::vector<ColorRgb> &ledValues)
const ColorRgb & color = ledValues[i]; const ColorRgb & color = ledValues[i];
// copy the most significant bits of the rgb values to the first three bytes // copy the most significant bits of the rgb values to the first three bytes
_ledBuffer[6*i] = color.red; // offset 1 to accomodate for the command byte
_ledBuffer[6*i+1] = color.green; _ledBuffer[6*i+1] = color.red;
_ledBuffer[6*i+2] = color.blue; _ledBuffer[6*i+2] = color.green;
_ledBuffer[6*i+3] = color.blue;
// leave the next three bytes on zero... // leave the next three bytes on zero...
// 12-bit values have zeros in the lowest 4 bits which is almost correct, but it saves extra // 12-bit values have zeros in the lowest 4 bits which is almost correct, but it saves extra