This week's goal: make a computer program that interfaces with an input device. First obstacle: make a working input device, being that my homework from Week 10 was a failure. I set out to finish to solder and program the Hello Mic board using Neil's python program. That worked out fine in the first intent, meaning that I did two homeworks this week! I will soon update the homework page of that week.
After I made the board work with Neil's C program in the microcontroller, and his python program in the computer, I set out to learn about my options of programming language for interfacing. I am interested in learning python, so I started figuring out Neil's code, which isn't so complicated, but after a few hours of reading python and Tkinter tutorials, I was intimidated by the serial communication part. Back in school, I always avoided to deal too much with serial communication in the electronics projects, which has not been too smart. So I set out to work with the Arduino IDE and Processing.
Working in the Arduino IDE for the Hello Mic board was easy once I figured out the tweaking that was needed to be done (took me a couple of hours to figure them out). First of all, I needed to start a Software Serial communication with the computer. After that, I got really small values off the microphone, which reminded me something that Neil told me in my homework assignment of Week10, which is that he set the reference voltage at 1V. I tried to copy his part of the C code that sets the voltage reference to 1V into the Arduino IDE to run it there, but it did not compile, for some reason I have to find out. So I looked in the internet for ways to do so with Arduino functions, which is possible with the analogReference() function. That lowered the voltage reference to 1.0V, so the readings that came from the microphone were much higher. You can see the Arduino code here.
After coding the microcontroller in a way that I understood its serial communication in a easier way, I set out to work in the Processing environment. That was fairly easy, following the tutorial from this link that my classmate John Rees shared with me. I basically copied the Processing code found at the end of the video which deals pretty easily with the serial communication, and changed it a little bit to draw circles to represent the information coming from the microphone. The code is here.