Go Down

Topic: EsploraLedShow example error (Read 880 times) previous topic - next topic

Grumpy_Mike

Just going through the examples and came across this error in the EsploraLedShow. That is part of the 1.0.3 IDE
Code: [Select]

// convert the sensor readings to light levels:
  byte red   = map(xAxis, -512, 512, 0, 255);
  byte green = map(xAxis, -512, 512, 0, 255);
  byte blue  = slider/4;


spot that red and green are mapped to the same axis, it should be:-

Code: [Select]
// convert the sensor readings to light levels:
  byte red   = map(xAxis, -512, 512, 0, 255);
  byte green = map(yAxis, -512, 512, 0, 255);
  byte blue  = slider/4;


It is fine in the library examples however.

Go Up