Download presentation
Presentation is loading. Please wait.
1
C# RADAR PROJECT YAKUP ÖZDEMİR 2010514054
2
COMPONENTS MSP430 HC-SR04 ULTRASONIC RANGE SENSOR
28BYJ-48 STEPPER MOTOR JUMPER CABLES BREADBOARD
3
SOFTWARE I used a simple C# library for plotting the values read from the ultrasonic sensor. Here is the link; I used the library below in order to rotate my stepper motor since original stepper library in Energia can not be applied to 28BYJ-48. For coding, i used Energia IDE and Microsoft Visual Studio
4
In order to use a library in your code, namespaces must be the same.
I made some changes in library in order to succeed my task. For example, i needed to change the graph according to my needs such that i wanted to plot distance that is read in the first form. System.Windows.Forms.Form f = System.Windows.Forms.Application.OpenForms[ ‘’Form1’’]; gives me the oppurtunity to access variables in the other forms so that i will be able to use variables in the listbox. In order to use a library in your code, namespaces must be the same.
5
Using the System.IO.Ports; gives us the oppurtunity to get port names easily. Port names are transfered into the combobox. In the button click event, timer has started and if port is not open, i tried to open and set some necessary values such as baud rate.
6
In the disconnect button event, i stopped the timer and close the port.
In the keydown event of the textbox, the only expected button is ‘Enter’ to write the value to the port. The reason why I substitue 9 from the original value is because of setting the speed of the motor.
7
In timer tick event, i read the values written by the sensor and transfer them into an array named ‘rng’ in order to plot the graph of the values.
8
This is the library that i use to rotate my motor
This is the library that i use to rotate my motor. In each case motor’s coils are trigged with an order. In order to prevent cable mess, i had to rotate motor in counter clockwise as well. Serial communication is the most significant topic in my project.
9
REFERENCES
10
QUESTIONS
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.