- Code: Select all
const int LeftSensor = A1;
int SensorLeft;
void setup(){
pinMode(LeftSensor, INPUT);
digitalWrite(12, LOW);
digitalWrite(A1, HIGH);
Serial.begin(9600);
}
void loop(){
SensorLeft = analogRead(LeftSensor);
Serial.println("LeftSensor = ");
Serial.println(SensorLeft);
delay(100);
if (SensorLeft = 30 || SensorLeft < 30){
digitalWrite(12, HIGH);
}
else
{
digitalWrite(12, LOW);
}
}
And it seems that when i power LED from 12th pin it like receives 1mA only. (By the way the LED should light up from the laser but it always stays on.) Thanks for help

