Week 31 - lglik/Portfolio GitHub Wiki
04/15/19 - 04/19/19
Day One:
Today, I worked more on the GUI. First, I worked with Nathan to figure out a good way to have everything reset when a user is finished with their show. This is tricky to do because arrays and attributes in many scenes need to be reset. We discovered that it is possible to reset these from scenes other than those that they are defined in which is lucky. I learned that kivy has methods that will call code when entering or exiting scene. I rewrote a lot of my code to use these new functions which are much cleaner than how a lot of the code was called before. There are a couple of different situations in which the project should reset so I made it that everything is reset whenever the GUI enters the start scene. With this new code I was able to get the timeout code to be fully functional pretty easily by making it go to thew start scene if no touches are detected on the screen after sixty seconds.
Day Two:
I've been working on getting more feedback from people about my GUI. One comment I've gotten is that the instructions are quite brief and don't really mention anything important. Currently, the instructions explain how pressing the magnetic tree buttons which change their state and pressing the next frame and prev. frame buttons will go to the the next frame and the previous frame. However, it does not mention that the user will be creating a show, nor does it mention what frames are. I added this information in and added some screenshots of a show to more helpfully explain the idea of the project. I also decided to make my project more educational by adding in a slide that explains both electromagnets and electromagnetism in a way that is hopefully easy for small children to understand. I also worked out and fixed some minor bugs I found with the show as well.

The revised instructions screen

The scene that explains electromagnets
Day Three:
I continued to try to improve the GUI by asking people for their feedback on it. I approached students who had never interacted with my project before and asked them to use it. I observed them interact with the GUI and asked them questions about their experience afterward. Mostly. the feedback was positive. However, I did observe and find out a few things. People seemed to struggle to understand that they could swipe the trees on the design scene. I could have added more information in the instructions scene, but I wanted to find a way to communicate the swiping capabilities of the GUI without making the instructions even longer. I decided to use the kivy to have an animation move an icon of a finger across the trees.
Day Four:
Today I started to work on the Schlieren effect project. This project runs off of an Arduino Mega and an Arduino multi-interface board. My job with this project is to program the Arduino to send PWM signals and receive input from sensors. This project does not have a GUI, so all of the code I will be doing will be back-end coding. I had to spend a lot of time refamiliarizing myself with Arduino's and the Arduino variant of the C programming language. I created a new file for the project and was able to turn on the LED that gets reflected in the mirror. I also was able to send a PWM signal to control both of the fans for the hot and the cold plates. I tried to send a PWM signal to the component that controls the temperature, but I realized that I would need a specific library for the motor controllers.

The Schlieren Effect Project
Day Five:
I was able to find out that the library I needed to fully utilize these motors was the RCServo library. This library is made by the DPEA and I was able to get it by downloading all of the libraries for the Carousel of Physics project. I figured out how to access this class and move the .h (header) file and the .cpp file from this library into the folder that my schetch was in which allowed me to use this library. First, I created to RCServo objects and called their connectToPin functions to assign each object to the pins connected to the motor controller and also passed each of them a maxPulseWidth and minPulseWidth value to define their range. I got these value from the prototyping code. I can use the function setServoPosition to actually control the Peltier devices. I can pass in any number between -1 and 1. Zero is off and the sign determines the direction of the current. For the cold plate, I passed it a 1 which made it as cold as possible. This plate can only get as cold as 55 degrees F which is not cold enough to be dangerous so there was no need to limit its power. The hot plate could get very warm at full power, so after some experiemntation, I set it to -0.5 which will make it as warm as 110 degrees F which is hot, but not dangerous. I still have to work on getting the temperature sensors running.