Prototype wrapup #32

Last week I was doing some prototypes for an art project, and this week was more of the same. Magic Beans web interface

Wednesday

This was the final version of the Lightblue Bean receiver code that triggered the servo and motor. I ended up having to do some extra tricky stuff because real life is harder than theory. Firstly, the servo and motor were powered by a USB battery pack which kept turning itself off. I considered this nifty solution but ultimately I just cheated and made the servo wiggle itself every 15 seconds. Secondly, the bluetooth interrupt gets triggered slightly before the data on the serial interface is ready, so I needed to wait a little while to synchronise the two.

Thursday

Finally, I rewrote the main router/controller program to make it work more reliably and have a web interface. The beans were tricky to keep connected, not least of which because of a bug that made the bluetooth stop scanning for new beans once it had found one. I just added lots more rescan calls and that fixed it. Adding a web interface made it easy to check if everything was connected properly and debug problems with individual beans, since it displayed all their serial messages.