Page 11 - Assessment No 1- 257
P. 11

void loop()
                        {

                          val = analogRead(sensorpin);       // reads the value of

                        the sharp sensor
                          Serial.println(val);            // prints the value of the sensor

                        to the serial monitor

                          delay(400);                    // wait for this much time before

                        printing next value

                        }










                      Output
   6   7   8   9   10   11   12   13   14   15   16