Week 12, 11/22: Interface and Application Programming


This week was daunting, because I'm a beginner in programming and coding, and the little experience I have from this class has been instructive, but mostly because I failed. There are many ways to fail, and many lessons to learn from each failure. So, looking on the positive side of things. In addition to lessons from failure, I had some minor successes.


One of the biggest lessons this week refers back to my final project in which I am learning about optics. I have learned about RGB this week in terms of the numeric attributions for colors. I know this will be very useful to me as I continue to take the tools I have learned in this class and apply them to my work. I learned that each designation – red, green and blue have a scale from 0-255 that appear in each iteration, combination of colored light. Different combinations of these numbers create different colors. 0 is the absence of color, and 255 is the most saturated color, so if (R, G, B) is (255, 0, 0) then the color that appears is red.


Demystifying RGB light combinations has taught me that my idea of creating a color choosing app for creators of Morningstar quilts is actually pretty straightforward.


I started off this week with this app idea:


Create a color choosing app in which the user can choose a three-, four- or five-color morning star canvas to start with. Each diamond can be clicked on to select it for adding color. Double-click to pull up a full spectrum color matrix, where you can touch any color on the matrix to choose and place it in the diamond as fill. Some basic features of the app include the ability to undo and re-do up to 100 times, the ability to increase a selection to include multiple diamonds at once to fill with the same color. In the main Morningstar screen, there are options for white/black balance and vibrance/ saturation in which a scrolling bar appears across the bottom, and the user can adjust these while still being able to see the Morningstar. You can save the image in low, med or hi res as a jpg. You can print it wirelessly or you can save it and email it to yourself.


How do I write the software to create this app? Completing several tutorials with Processing and MIT App Inventor allowed me to begin to play with different methods for accomplishing this goal.



Another important lesson this week has shown me the importance of user interfaces and event-driven programming. It has been helpful to me to think about and approaching this work by separating out the function of a user interface from the purpose of a program.


I created a couple apps in App Inventor, going through the tutorials to create apps for drawing and selecting color, including Paint Pot, Colored Dots and more.





I also created one in the spirit of my idea, called "Morning Star Color Chooser." In this app of my own design, I was not able to determine the areas on the Morningstar-shaped canvas that would need to be selected to fill with color, but I was successful in creating a menu of possible colors to choose.


I downloaded Processing, which I began to have a lot of fun with. Since writing lines of code, using commands and logic statements is new to me, I ended up with lots of errors, but was able to draw basic shapes, fill and outline them with color and make them move on my computer. I feel a new world of possibility opening up with my beginning to understand the use of this tool.


I am starting to learn C and Python, based on the c files for each week's lesson, and two reference books which have shown me some of the basics. I bought an Arduino starter package which includes and Uno board and a range of supplies needed to do embedded programming from the Arduino side of things. Arduino is helpful, but in many ways using the command line with C or Python actually makes more sense to me as I figure out how commands, scripts and code work. I mention this because I understand that Arduino is supposed to be a simpler solution with a large library of commands at the ready. I have found that it's better for me to learn the foundational aspects of how things work in order to best utlize them and I realize I can do this with C and Python.



The only working board that I am positive will be able to be programmed is the button board I made. I have made many boards over the course of this class and have had trouble with each. It's too bad the button board doesn't have an LED on it, because then I could do something cool with the LED, or at least know the board was powered.


I was able to do the "dudu" program on it. I wonder if I can create a similar program using the python serial terminal. I have been working to achieve this end, and have been dissecting the dudu program so that I understand its logic and the specialized recipe it creates. However, while before, when following the prescribed path, I was able to make the board work, now I am receiving error messages that my computer cannot find the USBtiny device, and that the recipe for target 'program-usbtiny' failed. I am starting to find comfort in the debugging process, although it can be baffling. I have to continue working on this.