Here I will start presenting the first part of our project with ARDUINO, made together with Jin Le
Here I made a video showing how this command is running:
The ultrasounds sensor is connected with the arduino, a led and a resistor. When the ultrasounds sensor detects something close, it sends a signal to light the led. This is done via arduino with this code:
First, we define the pings we're connecting the ultrasound sensor to the arduino. Then, in the void setup we tell the arduino all the outputs and inputs of the circuit. Now, we will creat a value that we call "readDistanceCM", which will read the ultrasounds sensor, and detect the distance of what there is in front of it. Finally, in the void loop, we will tell in which distance that it detects the LED lights on, and just to see the distance it detects, we can also do a Serial.println of the value