Page 68 - PROYECTO INTEGRADOR_Neat
P. 68

void loop ()


                  {



                    digitalWrite(trig , HIGH);

                    delay(1);


                    digitalWrite(trig, LOW);



                    t = pulseIn(echo, HIGH);

                    d= t/58.2;




                    if(d<150){

                    digitalWrite(4,HIGH);

                    digitalWrite(5,HIGH);

                    }




                    else

                    {

                      digitalWrite(4,LOW);


                      digitalWrite(5,LOW);





                    Serial.println("cm");

                    Serial.print(d);


                    delay(400);

                  }
   63   64   65   66   67   68   69   70   71   72   73