PunchThrough Design's Light Blue Bean is an amazing BLE Arduino device. Now imagine if you had a button on it that allowed you to control any device or trigger off an Octoblu flow that set off some of IoT interaction! Well with some easy soldering and a little bit of code we can make it possible to create some amazing apps!
First things first! We'll wire up the button to the bean. Below you'll find a list of components needed, a diagram explaining the wiring, and some pictures that show what we found to be the best way to wire the button to the be
Now let's connect the Bean Button to Octoblu!
There are two methods to do this. One is fairly simple and uses the Octoblu Gateblu plugin and an Arduino script that updates a scratch characteristic, the other method is for users with some Node.Js experience but it gives you more functionality (i.e. Up, Down, Hold).
Method One - Using Gateblu and Arduino
- Start off by downloading the Bean Loader App for OSX and Arduino IDE for the bean from http://punchthrough.com/bean/getting-started-osx/
- Follow the Getting Started Guide to configure your bean with a new localName.
- Next we need to set up the Light Blue Bean Gateblu plugin. The process is the same as this tutorial, except that you'll be adding the Light Blue Node instead.
- After the plugin finishes installing you'll see some options and a save button. Enable "notifyscratch1" and enter your bean's localname in the "localName" parameter and hit save.
- Open up the Arduino IDE and burn the following sketch to your bean.
- Be sure to close both the Bean Loader and the Arduino IDE before starting your Gateblu gateway.
- Once your Gateblu is up and running, goto the Design page on app.octoblu.com and add the follow flow.
https://app.octoblu.com/design/import/90665450-a5b0-11e4-b6fc-93d74e29eab8
Deploy the flow, and if everything is set up correctly you will see the state of the button as a "0" or "1" in the debug tab.
Method Two - Using bean-io and Node.Js
The example below uses Node.JS and bean-io (see @iceddev's bean-io writeup here - http://blog.iceddev.com/2014-09-15-beanbots-rise-of-the-swarm.html)
Run this node app on your PC/Mac to connect the Bean to Octoblu and listen for button pushes:
Create the following flow in Octoblu -https://app.octoblu.com/design/import/68ebf690-a5ac-11e4-b6fc-93d74e29eab8
This flow will watch your Bean Button and change your ThingM Blink(1) color to blue when the button is held and turns it off when you let it go!
You could easily have Octoblu call to order you a pizza when pressed or open/close your garage door using the MyQ device, etc.
Comments