Page 79 - Proyecto
P. 79

Serial.println("cm");
                                      Serial.print(d);

                                      if (d<=150)
                                        {
                                       digitalWrite (ld1, HIGH);
                                       delay(500);
                                       digitalWrite (ld2, LOW);
                                       digitalWrite (ld3, LOW);
                                        Serial.println("cm");
                                        Serial.print(d);
                                      }


                                       if (d<100)
                                        {
                                       digitalWrite (ld1, HIGH);
                                       digitalWrite (ld2, HIGH);
                                       delay(500);
                                       digitalWrite (ld3, LOW);
                                       Serial.println("cm");
                                       Serial.print(d);
                                        }

                                        if (d<50)
                                        {
                                       digitalWrite (ld1, HIGH);
                                       digitalWrite (ld2, HIGH);
                                       digitalWrite (ld3, HIGH);
                                       delay(500);
                                       Serial.println("cm");
                                       Serial.print(d);
                                        }

                                        else
                                        {
                                           digitalWrite(ld1, LOW);
                                            digitalWrite(ld2, LOW);
                                            digitalWrite(ld3, LOW);
                                       }
                                    }














                                                           74
   74   75   76   77   78   79   80   81   82   83   84