MBP
MBP copied to clipboard
Light sensor inversion not needed on current LK-Light-Sensor
Despite the information on the Linkerkit webpage (http://www.linkerkit.de/index.php?title=LK-Light-Sen) the recent version of the light sensor seems to be already inverted. This means the values are getting larger when more light hits the sensor. This has been confirmed using the MBP, an Arduino UNO and a multimeter. The sample code on the Linkerkit webpage indicates that older revisions needed the inversion.
The AnalogInputReader class does an inversion of the value in line 39 of mbp_analog_reader.py.
resistenceSensor = ((1023 - v0[1])*10)/v0[1]
The inversion could either be removed or a bool added to the init function to toggle between value and inverted value.