C# RADAR PROJECT YAKUP ÖZDEMİR 2010514054
COMPONENTS MSP430 HC-SR04 ULTRASONIC RANGE SENSOR 28BYJ-48 STEPPER MOTOR JUMPER CABLES BREADBOARD
SOFTWARE I used a simple C# library for plotting the values read from the ultrasonic sensor. Here is the link; www.codeproject.com/Articles/32836/A-simple-C-library-for-graph-plotting 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. www.instructables.com/id/BYJ48-Stepper-Motor/?ALLSTEPS For coding, i used Energia IDE and Microsoft Visual Studio
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.
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.
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.
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.
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.
REFERENCES http://www.rhyous.com/2010/06/18/how-to-limit-or-prevent-characters-in-a-textbox-in-csharp/ http://stackoverflow.com/questions/5348844/how-to-convert-a-string-to-ascii http://www.cagatayodabasi.com/2013/01/msp430-launchpad-bilgisayar-kontrollu.html http://energia.nu/Map.html http://msdn.microsoft.com/en-us/library/7ewkcdb3%28v=vs.110%29.aspx http://www.youtube.com/watch?v=7xCVSWVLRKg http://www.codeproject.com/Articles/32836/A-simple-C-library-for-graph-plotting http://www.instructables.com/id/BYJ48-Stepper-Motor/?ALLSTEPS
QUESTIONS