Updated 12/18/2018:
I've added the project source to GitHub and linked to it in the attachments.
Updated 12/16/2018:
When I first transferred to the University of Alabama in Huntsville (back in 2013) to get a degree in Electrical Engineering, I was excited to get started with a tangible project. I purchased this kit not having a clue how microcontrollers work.
Like many of you, I used the Arduino API to handle everything, and wasn't aware of how any of it actually worked. I ran into the small micros' performance limits very quickly because of trying to do too much, and waiting in while() loops for tasks to finish.
There are two performance-related tasks related to this project that I have learned how to improve since those days.
1. Crank up the baudrate for your serial UART connection as fast as you can, because why not? The only reason the slower speeds exist are for noisier environments. Modern PCBs are pretty good, but if you run into problems with a custom board, lower it until it works.
2. Don't wait for the ADC to read an analog value. In my example code, I show how to break apart the Arduino source code for analogRead() to separate it into three separate tasks. The second of those three tasks originally includes a while loop to wait for the ADC to finish converting the analog voltage into a number. In my example, I provide a function to check, and show how to create a simple state machine to take advantage of this without doing something in the wrong order.
I'm hoping to keep coming back to this and continue adding features. My 6yo daughter was asking me what it could do and now it can do more than collect dust!
Comments