In fact my device is remake of this radar: http://howtomechatronics.com/projects/arduino-rada...
But I think that making a remake is worth it, because, even despite my version isn't that goodlooking, I don't use such poor 'technologies' like passing through serial port STRINGS instead of single bytes or double negating(from the link: "rotate(-radians(-30));").
Besides that, in my opinion Labview provides wider variety of different controls than Processing, so it allows me to use joystick to control position of the servo. In addition, Labview is very simple language to learn - it took me about three days to acquaint with IDE and make this project. So, if you feel up to make the same radar - all questions or comments are welcome. Good luck!
All photos, sketches and .vi files can be found in attached archive.
P.S. My english language knowledge is based on russian secondary school education, so I'm sorry for the mistakes I've made.
Ingredients for radar:
Ultrasonic sensor is mounted to the servo via hot-melt glue. In Russia we call such way of mounting "by snivel", but another game isn't worth the candle. However, the link from the introduction can lead you to good design solutions.
Unfortunately, I had some problems with LabView VISA(Virtual Instrument Software Architecture) drivers, that are responsible for communication with peripheral items(in fact it's COM-port driver for LabView). There were two options to solve the problem:
For obvious reasons I chose the second one.
For those, who don't have LabView yet, I attached screenshots of so called 'block diagrams' and 'front panels' of SubVIs. Every block diagram is 'equipped'(sorry, I don't know how to say correctly) with comments. Again: all questions and comments are welcome.
The main.vi file is also 'equipped'(again I'm sorry) with comments. Ask, if something isn't clear. The only additional point that I've to state is that graph's default appearance isn't that nice :) I've spent plenty of time configuring it.
In the 'block diagram' you can find one more SubVI: 'EDGE?'. It return true, if input integer equals 180 or 0 and false otherwise. In the top of the step you can find screenshot of the block diagram.
I don't attach any screenshots to this step, 'cause even if you don't have Arduino IDE, you can open .ino file via notebook.
The code isn't that complicated to require any additional description. As Subodh Gupta states, 'Everything is inside'.
Don't forget: joystick can be easily replaced with potentiometer - you just have to gather(I'm sure, this's incorrect word) the simpliest voltage divider.