Hello, my name is Hugo, im 16 years old and i work on a project. I have to found an arduino code which can switch on the sensor SRF 05. I would like too that when the SRF 05 detect an objet, 5 led switched on ! Sorry if my english is too bad ! Thank you very much, see you soonHugo

// written at: luckylarry.co.uk// variables to take x number of readings and then average them// to remove the jitter/noise from the SRF05 sonar readings

const int numOfReadings = 10; // number of readings to take/ items in the arrayint readings[numOfReadings]; // stores the distance readings in an arrayint arrayIndex = 0; // arrayIndex of the current item in the arrayint total = 0; // stores the cumlative totalint averageDistance = 0; // stores the average value

analogWrite(redLEDPin, redLEDValue); // Write current value to LED pins Serial.println(averageDistance, DEC); // print out the average distance to the debugger delay(100); // wait 100 milli seconds before looping again