Controlling 4 Servos with a Button
Up until now, we've been focused on controlling out LEDs and haven't given much thought to the mechanical control portion of our software. We're starting to build our first prototype soon though, so we needed to put together a basic method for controlling our 4 servos in order to open and close the four segments of outer box as discussed in this post.
We've succeeded in opening and closing all 4 servos in the correct order at the push of a button (critically separate from the computer-controlled portion for ease of use). The video shown above is a demo of this system working.
Because the lid fits together like a puzzle, the order in which all the servos open is crucial. We can toggle the time delay between each servo opening once we're able to test the servos on our particle board prototype. Unfortunately, there is still a bug with using the button. In order to close the lid, the user must press and hold the button rather than pushing it once, which is likely due to the fact that we used delays instead of using a counter. We will be able to fix this bug by implementing a counter in later iterations of the code.
After fixing this bug, we will integrate the arduino code for servo and LED control followed by development of a basic GUI.