Ultrasonic Radar
|
|
Topics:
Motor movement and Ultrasonic sensor |
Last updated:
21-10-12 |
|
Find inspiration to the
construction
here or try your own
design
|
|
|
|
|
Exercises
/ Problems: |
Create a program which:
-
Turns the US
(Ultrasonic Sensor) 180 deg. First Clockwise and
then back again.
-
Keep track of the
objects in front - seen by the distance from US
-
Update the display
with the actual data (distance to objects)
|
|
|
Radar_Start_Help
|
|
|
. |
. |
|
|
|
|
|
Run the program and watch the screen
- Try to understand and describe whats going on:
How does the RotateMotor influence the movement of the
motor?
Try to change the SPEED value - Remember to download the
program as well
Whats the meaning of the two LineOut - function calls?
What does the value 255 from the US sensor mean?
How many task does this program of and why not only one
task? |
|
|
|
|
|
|
Version 1 of the US Radar: |
|
. |
. |
|
Use the
Position information in combination with the Distance
from the US sensor to put Circles at the Screen.
The data structure Radar could be useful to store the
result of the scan.
(Please not that one scan consist of a Clockwise and a
Counter Clockwise turn)
The circle at the top of the screen shows that theres an
object at 128 cm distance from the sensor.
The others mostly at the distance 40 cm.
Extra excersise - show
some dotted guide lines at the screen for each 20 cm
distance. |
|
|
|
|
|
Version 2 of the US Radar: |
|
. |
. |
|
In order to keep track of changes at
the screen image would it be nice to remember to former
scan and present it as circles without filling.
Hint! Define an
extra array called Former which could be loaded with the
data fra Radar each time a new scan starts. |
|
|
|
|
|
Version 3 of the US Radar: |
|
|
|
|
Create a screen image which shows a
halfcircle instead (more like a real radar image)
The dotted arc could be 100 cm. |
|
|
|
|
|
|
|
|
|
|