mirror of
https://github.com/brmlab/ledbar.git
synced 2025-06-10 05:44:01 +02:00
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:
parent
ac8e6cd3a9
commit
b809208b60
3 changed files with 5 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "../ledbar.h"
|
||||
|
||||
/* FIXME: cmin[] is not handled properly here, it's the level of 1, not 0. */
|
||||
|
||||
class Ledbar lb[NUM_TLCS];
|
||||
int c[cpinsets][CH];
|
||||
|
||||
|
|
|
@ -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(" ");
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ const int cpin[LEDS_PER_TLC * NUM_TLCS][CH] = {
|
|||
#define cpinsets (sizeof(cpin)/sizeof(cpin[0]))
|
||||
|
||||
/* cca 2.7ohm resistor per channel */
|
||||
const int cmin[cpinsets][CH] = {
|
||||
const int cmin[cpinsets][CH] = { // level of 1 (not 0!)
|
||||
{ 4, 0, 0 }, /* box 1 */
|
||||
{ 5, 0, 0 }, /* box 2 */
|
||||
{ 5, 0, 0 }, /* box 3 */
|
||||
|
@ -122,7 +122,7 @@ const int cmin[cpinsets][CH] = {
|
|||
{ 5, 0, 0 }, /* box 19 */
|
||||
{ 5, 0, 0 }, /* box 20 */
|
||||
};
|
||||
const int cmax[cpinsets][CH] = {
|
||||
const int cmax[cpinsets][CH] = { // level of 255
|
||||
{ 120, 250, 190 }, /* box 11 */
|
||||
{ 100, 250, 180 }, /* box 2 */
|
||||
{ 100, 250, 180 }, /* box 3 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue