arduino: Change cmin[] semantics - pwm level of channel level 1, not 0

Should eliminate dim red light for black pixels.
This commit is contained in:
Petr Baudis 2012-08-19 23:38:24 +02:00
parent ac8e6cd3a9
commit b809208b60
3 changed files with 5 additions and 3 deletions

View file

@ -28,7 +28,7 @@ void loop()
while (!Serial.available());
unsigned char s = Serial.read();
//c[led][i] = s;
c[led][i] = map(s, 0, 255, cmin[led][i], cmax[led][i]);
c[led][i] = s == 0 ? 0 : map(s, 1, 255, cmin[led][i], cmax[led][i]);
//Serial.print(c[led][i], DEC);
//Serial.print(" ");
}