task main () {
SetSensorLight(IN_1);
while (TRUE) {
SetSensorType(IN_1, IN_TYPE_LIGHT_ACTIVE);
Wait(1000);
SetSensorType(IN_1, IN_TYPE_LIGHT_INACTIVE);
Wait(1000);
}
}
To ensure that the transmitter is working, I am using my phone camera. Indeed, the transmitter is working, but it is not turning off...
Does anyone know why this might be?
The green one is always powered (when the NXT is on). It is the sensor supply voltage.
Pin 5 (yellow) is the control pin used for the light sensor. It is turned on and off to control the light. You should use a transistor to handle the power though.