Week 15 - Interface Application Programming
Assignment: write an application that interfaces with an input and/or output device
My plan for this week is to make an application on linux to connect to the microprocessors in the final project. I will program it using python. The application will retrieve live data from the internet and send it to a microprocessor.
finding data
The only data I had in mind was data from space. Being a regular user of spaceweather.com I decided to look what data was avalible there. I decided to get some data related with the sun since there is much data out there and I find the sun very fascinating. First I thought about doing something with the sunspot number or the flux but it quickly became unclear and looked like it would be too complicated at that point. I then looked at the speed of the solar wind and they seemed to range from 300-400 km/sec so to begin with I decided to use that number and turn it into the frequency in Hz. I had a hard time getting the data from the page because it was not in the source code. After looking around I found out where most space wheather realetaed sites get there data from noaa.com .Navigating and shearching some more led me to this text document ace_swepam_1m.txt It seemed like a good starting point. It had for example some data from the saterlite ACE (Advanced Composition Explorer)
Sides looked at
HTML Scraping
HTML scraping was a new term for me but as I understand it makes a program go to a web address and gather data from the html source code. Since I was using a .txt file I had to somehow turn the source code into stripes and lines. This was new to me and I had help from my instructor to do that. I took like 18 and stripes 52-60 and then you get a number that represents the bulk speed in km/sec
Sides used
Making it work in linux
To be able to see what was going on in the program there is a print commands in the code so you can see what is happening. To run the program you put python2.7 Fabacademy_mastercode.py /dev/ttyUSB0 in terminal. I used virtual machine on virtualbox to run linux. It needing minor adjustments and then began to run smoothly.
the program in terminalInterface
I don't have any interface in the final program. I made a interface in the Mechanical And Machine Design week