Watch the demo video:
Circuit used
I used "PING)))" ultrasonic sensor that has only 3 pins.
Connections:
GND Pin on PING))) ----> to GND pin on Arduino
5V Pin on PING))) ----> to 5V pin on Arduino
SIG Pin on PING))) ----> to digital pin 7 on Arduino (You may use any other digital pin)
Codes
There are 2 codes. The first one should be uploaded to the Arduino board. It is responsible for detecting the distance of the closest object in front of the sensor, and sending the distance to the computer via USB.
The other code is a Matlab code responsible for receiving the distance from the Arduino and plotting it.
the matlab code have this error
ReplyDeleteWarning: Unsuccessful read: Matching failure in format..
In an assignment A(:) = B, the number of elements in A and B must be the same.
Error in realtime_plotter (line 26)
CM(2)=fscanf(arduino,'%f');
How can i solve it ?
Hi
ReplyDeletei am facing the same problem, if you had been solved it ,can you please help me