Well, the day has finally come. Alex, Katie and I have spent the past couple of weeks working together on what seemed like an inconceivable idea considering our collective aptitude in physical computing and processing, but we finally crossed the finish line. Alex and I are set to present tomorrow and we will be in the winter show over the weekend. While there are still a few bugs to adjust in the interim, we are confident that we will have those fixed by the time it will be shown to the world (or at least whoever comes to the show on Sunday and Monday).
Since my last update, there has obviously been quite a bit of changes in all aspects of our project. We spent sleepless nights working on the code to not only make it aesthetically pleasing and fully functional, but easy for someone to navigate between the three modes. After bringing everything into Sublime and meeting with one resident and professor after another, we created three separate sketches and a menu that would eventually be manipulated by the base, bat, and helmet. An abundance of adjustments were made over the past couple of weeks tweaking everything from the pitch velocity to the color of the ball being thrown, etc. Additional graphics were created to make the actual sketch that much more inviting for the participant. Upon having everything completed and in working order, we began to integrate our arduino code into the sketch and were met with the biggest challenge yet: we could not use three different .js files (as they were set up for each mode) to be controlled by three different components using three different serial ports.
Thus, after quite a bit of shouting, binge eating, and trips to the gym (at least all of the aforementioned for me) – – we met with Dan Shiffman to discuss the best possible solution. His advice: combine everything into one p5 sketch and then meet with Shawn Van Every to discuss how to integrate all of our components into one sketch. Initially, we thought that we were going to have to use node.js (which no one had any familiarity with) but after talking to more advanced students, we found out that was not the case.
However, we did have to combine all of the sketches into one and that was quite a tall task considering the amount of code we had used. Many of the variables were the same, so we had to meticulously go through each line to ensure that nothing was duplicated and everything was being drawn correctly. After facing our fair share of challenges, we finally had all of the code working in cohesion in ONE .js file.
Next, was integrating our Arduino code into the sketch to have the physical bat respond to the bat on screen, the helmet change the pitchers in game mode, and the base toggle between the three modes. We created the three serial ports, had two of the components respond by bluetooth (bat and helmet), and adjusted the code accordingly to allow for a fully interactive game. We (and this was primarily Katie if I’m being honest) created the necessary housing to allow for the base with three FSR’s to change between the modes, extended the bat to hold the Arduino 101 and haptic motor and created a backing on the helmet to hold the Arduino and battery pack. As you can see in the pictures, it came out unbelievably well.
Because we all are fully aware of how projects don’t always go well during a presentation, we have created this video that documents or baseball simulation working in unison and to also be used as a tutorial at the winter show for novices who have never stepped on a baseball field.
It was a true pleasure to work on this project with two people who were not only as obsessed with sports as myself, but also exhibited the type of working relationship (through the many hours we spent together) that I hope to have with colleagues in the future.
Alex and Katie, if you ever read this — you two are the best and thank you for being so incredible to work with these past couple of weeks. Now, let’s watch Alex attempt to play our surprisingly difficult game: