Making customized apps to interface with your projects
I wanted to make a custom interface app for my magnet sensor so I looked at a few different softwares I can possible code in. Arduino and Processing seemed to be the most beginner friendly so I chose those two. Now one important thing I did realize beforehand and face before was the problem with serial data input from the board. I even had further trouble running Neil's python code initially and had to resort to using cygwin which was a program that let me emulate Linux onto the Windows machine I was using. After studying the samples in Processing, this time I used a software solution called Software Serial, where in the case of Processing I used "import processing.serial.*;" which allowed me to make the serialPort recieve data. After I set up a window size and which port I would access in void.setup for the app, and in void.draw make a continuous string of integer values. Then where I made a simple If statement where if the magnet recieved a value higher than 500, it would turn red; else if the value was blue, representing North and South as you switched the magnet's positive and negative sides. The rectangle where the value would show was also coded in a way so initially the two first values represented the x/y axis for the rectangle start and the next to values represented the length and height of the rectangle. Setting (500,100) as the center if the magnet sensor value was over 500 it would
I also made an Arduino file for my mag sensor so when serial data from pin 4 is recieved, the pin 1 connected LED would flash, giving me a confirmation on its recieving data and then send it as output serial data.
Code files Arduino Processing