Because I spent most of the week of town for Thanksgiving, I tried to keep it simple for this week (well, simple given I've never done anything like this before). My goal was to create a very simple user interface to run a servo. I used Python with Tkinter and PySerial, and the Arduino IDE.
I found this simple tutorial on getting started with interfacing PySerial with an Arduino, and built off of that to write my own Arduino and Python code to control a servo. Even before worrying about the user interface, I tried debugging this first. The servo did move when I ran the Python program, but somewhat intermittently and unexpectedly, and usually only if I hit Reset first. I'm not entirely sure what was happening, but I decided to throw in the user interface anyway and see if I could debug the whole thing.
I found this tutorial to be a great place to start with using Tkinter. I added in a very basic user interface, just something to start the servo and quit the program. It didn't work - in fact, nothing showed up in the Serial Monitor. Amir, the TA, helped me debug the program. The problem seemed to be mainly how it was interfacing with the serial. The code that worked for me is below.
I tested this with Amir and it worked great! Unfortunately, I wish I'd thought to film it at the time for the reasons explained below.
When Amir saw me using the FabISP with the Fabduino, he told me that it's actually possible to burn the bootloader, and then I wouldn't have to use the ISP anymore. It sounded great, so we tried it! However, what I forgot was that on my original board, as mentioned in last week's assignment, I'd forgotten to connect the CS/CTS pins to anything. So burning the bootloader didn't work. I decided I'd do that for the next iteration of my board for the final project.
Later that evening, I tried hooking up everything again so I could film my successful servo interface. And it didn't work. I got this error from the Arduino IDE:
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
The computer recognized that the board and the ISP were attached, but there was some other problem anyway. I also tried using another classmate's ISP and had the same problem. The only thing I could conclude is that the failed attempt to burn the bootloader somehow messed up the Fabduino. Unfortunately at this point I don't have enough time to make another Fabduino to show the video of the working program for this week, but the TA, Amir Lazarovich, can vouch for me that it worked. Meanwhile, I need to try to work out why burning the bootloader would have messed up the Fabduino.