After coordinating with our “clients” (Roland, Kellee, and Sandy) Vidia and I focused on building a 1:5 scale model that is controlled by the wifi enabled Arduino MKR1000. As was described by our client team, the server identifies tasks to be completed by changing the corresponding value in its JSON from a 0 to a 1. For example, if the height needs to be adjusted, the server would change the “Adjust Height” value to 1.
Our machine on the opposite end checks every half second to see if the values have changed. Once it sees that the “Adjust Height” value has changed, it performs the lowering task and returns a 0 to the server. This exchange also occurs when the machine is reset.
The machine also has sensors built into the stick supports to notify the server if the stick has been touched–a penalty in limbo.
While the machine and server are indeed talking comfortably to each other, Vidia and I both agree that there may be a more efficient way of doing this. We haven’t figured it out yet, but the ideal would be for the machine to only activate when a value on the server has changed. We are also using Arduino’s Wifi Client library when we could probably do better with their HTTP Client library. We may implement these when we build the full-scale version. 😉 Arduino sketch code is attached below: