I got 2 mBots and I encounter the same issue on both. I’m reading the value of the sensor and it starts at 300 something and it drops to about 250 after a few seconds and osciallates with a few units. The problem is that the value doesn’t change if I cover the sensor or point a source of light to it. I’m running the example MeLightSensorTest.
LightSensor on mBot not working
Hi,
I also got 2 mBots, and I experience the same issue as you . If I cover the light sensor I don’t see any significant value change.
Hope it’s a software issue, not a HW one.
Today I have checked again.
I have 2 mbots.
The light sensor is working with one of my mbots, but the same little piece of scratch code gives nearly constant values for the other one.
Therefore, this seems to be a hardware issue rather than a problem with the software.
Any feedback from other user or the Makeclock team?
Thanks!
I have the same problem. Connected a lightsensor to a MegaPi port but read one and the (somewhat) same value.
Would appreciate if someone from Makeblock would clear up this problem…
#include "MeMegaPi.h"
MeLightSensor lightSensor(PORT_5);
int value = lightSensor.read();
Serial.println(value);
Hi Gino_talamini,
Do you use this light sensor shows below:
From the picture, you can see it has black RJ25 interface,so you can only connect it to Port 6, 7 or 8 on MegaPi.
From the picture, you connect it to Port 5.
Aaaarghhhh. Stupid of me. You are completely right!
I changed to another port and now it works as expected!
Thanks for the wake-up call.
Kind regards,
Gino