Wednesday, September 18, 2013

Circuit Design, Embedded Programming with C and JavaFX

So awhile back I decided that I would not be shown up by EEs with their cool understanding of manipulating the physical world while all I was able to do was manipulate the virtual world. I decided to learn circuit design and embedded programming. I remember seeing a cool youtube video of lights dancing around in tune with music frequency so I thought let me try.

Anyway, once I got the basic breadboard and electronic components down it was rather ez. Electronics is not that much different than programming really. There are components that help you control the flow of current (not unlike software components that help you control the flow of data). The micro controller I used was an Atmega168. It took care of the analog to digital conversion. I wrote a simple program in C and flashed the microcontroller with it. All it did was continuously read from a data in port (serial) and opened one of it's I/O ports to let current through to LEDs. Then on the computer I wrote a JavaFX app that detected the frequencies in a music file and in real time wrote to a port when the frequencies were at certain levels.

Anyway here is the example. I can put the source code up if there is any interest.

No comments:

Post a Comment