#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    5
    Rep Power
    0

    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.
  2. #2
  3. I <3 ASCII
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Aug 2003
    Posts
    2,399
    Rep Power
    1232
    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.

    -MBirchmeier
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    5
    Rep Power
    0
    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?
    Thanks again!
  6. #4
  7. I <3 ASCII
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Aug 2003
    Posts
    2,399
    Rep Power
    1232
    This is a great reference to help you get what you're looking for.

    -MBirchmeier

IMN logo majestic logo threadwatch logo seochat tools logo