Pages: [1]   Go Down
Author Topic: EsploraLedShow example error  (Read 724 times)
0 Members and 1 Guest are viewing this topic.
Manchester (England England)
Online Online
Brattain Member
*****
Karma: 508
Posts: 31429
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just going through the examples and came across this error in the EsploraLedShow. That is part of the 1.0.3 IDE
Code:
// 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:
// 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.
Logged

Pages: [1]   Go Up
Jump to: