myPort.bufferUntil('.'); // reads the data from the serial port up to the character '.'. So actually it reads this: angle,distance. angle= data.substring(0, index1); // read the data from position "0" ...
The ultrasonic sensor emits sound waves and measures the time it takes for the waves to return. This time is then converted into a distance. The servo motor rotates the sensor from 0 to 180 degrees, ...
Physics Undergraduate @ NED | Ex Intern at Codealpha |Arduino & Electronics Developer | Front-End Developer | Building Embedded, IoT & Robotics Systems | Interested in Computational Physics & ...