March 20th, 2012, 11:22 AM
Displaying data graphically (Ultrasonic radar)
Hi all, a beginner here
I'm working on an ultrasonic sonar and I would like to use the computer to display a standard green radar system detecting the objects.
I'm using a micro controller with the software written in C to send out the sensor's angle and position and it works fine.
On the computer side, I'm using Visual Basic 2010 to read the COM port which then contains the sensor's data in numbers (sensor's angle and distance between sensor and object) which is a constant stream. On the debug screen (Textbox) I can already see all the data coming through.
Now my question is: How do I convert those numbers into graphics?
More explanations about these numbers I want to convert:
I have a step motor to rotate the ultrasonic sensor, and it works that way:
The motor advances 1 step forward, then measure distance between sensor and object, then send these 2 values out.
So, if you see the attached file, those numbers on the text box mean:
000032 -> 000: step number & 032: 32cm between sensor and object
001031 -> 001: step number & 031: 31cm between sensor and object
002032 -> 002: step number & 032: 32cm between sensor and object
003007 -> 003: step number & 007: 7cm between sensor and object
and so on...
So those are the numbers I wish to convert into graphics. The scan line would need to rotate clockwise at same speed of the step motor. And then I would like to display dots when an object is detected.
Thanks in advance!
My O.S.: Windows Vista 32 bits.
Softwares: MPLAB IDE v8.53 (microcontroller part) and Microsoft Visual Basic 2010 Express (computer part)
***Sorry I can't attach any file as the regulation says I'm not allowed to, because I'm a new user.
March 20th, 2012, 01:50 PM
Since you're using VB.NET I'd start with looking in the System.Drawing Namespace. It might not answer all your questions, but if you start diving into that you will likely glean enough information on how to piece together a canvas, a pen, and draw lines.
March 21st, 2012, 05:17 AM
MBirchmeier: Thanks for your reply. I figured out how to draw lines using e.Graphics.DrawLine. Now, how can I plot the real-time data coming from the serial port?
March 22nd, 2012, 07:31 AM