Back to Parent

//trials for both sensors

int p= A1;
int l =A0;

void setup() {
    pinMode(l,OUTPUT);

}

void loop() {
    int val= analogRead(p);
    if(val>1000){
        digitalWrite(A0,HIGH);
    }
    else{
        digitalWrite(A0,LOW);
    }
   
}



//trial 2

int res= A2;
int l =A0;

void setup() {
    pinMode(l,OUTPUT);

}

void loop() {
    int val= analogRead(res);
    if(val>100){
        digitalWrite(A0,HIGH);
    }
    else{
        digitalWrite(A0,LOW);
    }
   
}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0