#include //include LED library #define PIN 8 //LED PIN #define NUMPIXELS 30 //Number of LEDs // defines pins numbers of sensor const int trigPin = 10; const int echoPin = 9; // defines variables for calculation long duration; float distance; Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); //LED output variable void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input pixels.begin(); // This initializes the NeoPixel library. Serial.begin(9600); // Starts the serial communication } void loop() { // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the distance distance= duration*0.034/2; // If statement to light up LED only if hand is in front of it if(distance <4 && distance >0){ for(int i=0;i