Introduction: Btton.Co

You're at a packed bar, immediately the music cuts off and "Eye of the Tiger" starts blasting. You notice a few heads turn towards the front door, so you turn too. The front door slowly opens to reveal a figure wearing a sleek jacket.

The bar sighs in shock and mutters, "How?" "I can't even.." Across the room, you notice a couple's interest for one another progressively fade away the longer they gaze at the Person in the Jacket.

Immediately, the person next to you's head explodes, as he fails to make sense of the situation, yet you remain focused and unfazed. You don't believe in magic unless it comes in the form of a trading card game, thus you continue to analyze the situation. That's when you notice a button at the jacket's collar that is subtly different(and better) than all other buttons. You've cracked the mystery.

...and so you wipe your lesser bar-mate's blood off your face and approach the Person in the Jacket.

You: "Where'd you get that button?"

Person in the Jacket: "Btton.Co"

You: "Nice."

________________________________________________________________________________________


With BttonCo, this experience is just one click of a wearable button away. We're still working on the "time slow down" function and head explosion liability is going to be an awkward topic to bring up with investors, but while we work on that, there's plenty of cool things we can do with Btton.Co technology as it is today!

Let brands get on your good side by sponsoring you with their products and services while you're out and about.


We are the iot solution for 1 click sponsorships. What this means is that we give brands opportunities to interact with you based on your interests and location, all you have to do is click a button.

In the scenario above, the "Person in the Jacket" used a click of our Btton.Co button to play "Eye on the tiger" as he/she entered the bar. This click was sponsored by TouchTunes, a company that has wi-fi enabled jukeboxes in over 60,000 bars and restaurants across North America.

Similar experiences can be had with other brands who do business in other areas. Let's say you're a hungry vegan at a sports stadium. A new brand of vegan hotdogs that is doing business in the stadium can spot you a vegan hot dog by sponsoring a click for you. All we need to know is that:
1. You're a vegan.
2. You're currently in a stadium in which the new vegan hot dog brand is sold.

Sponsorship opportunities are only triggered when your interests align with your Geo-location.

So kiss goodbye the era of intrusively irrelevant advertising and hug hello the era in which brands give you cool experiences you actually care for, with Btton.Co!

_______________________________________________________________________________________

Here's how we made it:

Step 1: Tools and Materials

Jacket Materials

- Generic White Doorbell from Home Depot or similar

- Tailored leather coat, with a high collar or lapel

- Intel Edison module, with WiFi

- Double-ended Crocodile Clips, Alligator clips wire

- Mobile Battery Pack, 4 “AA” Battery Holder (6V)

- 2 Micro USB cords

- Bright blue , 5mm Round LED, 20 mA

- WiFi Hotspot, or Internet sharing smartphone

Tools

- Computer with Intel XDK Installed

- Soldering iron and solder

- Fabric sewing kit

- Leatherman knife or similar, to modify jacket


Step 2: Mount the Smart-Button into the Jacket

With your blade, puncture the leather jacket’s top collar in the most aesthetic position, centered and deliberate.
Use a small ‘X’ mark that is 2cm in length. Make sure it is not too big, to ensure a secure fit for the doorbell.
Wedge the doorbell into the small slit, and ensure it has a tight fight, and all the two metal prongs in the back are exposed correctly.

Step 3: Wiring the Jacket

Utilizing the alligator clips connected to the doorbell, carefully attach the leads to the exposed prongs on the back of the button. Guide the wiring down the jack on the inside, and optionally sew the wiring inside the jacket lining. We will be using the inside jacket pocket for the battery pack and the Edison board – thus all wiring should lead into the pocket in a subtle way.

Step 4: Battery Pack and Web-enabling the Edison Chip

Once you have you configured the Edison board, attach the battery pack to allow the board to not rely on a wired power connection. Ensure that you configure your SSID and wifi settings to allow the Edison to connect to the hotspot of your choice. In our case, we placed a hotspot in the opposite pocket, and associated with the appropriate MAC address. Once you have SSH into the unit make sure to run “configure_edison –wifi” to manipulate the settings.


Step 5: Wiring the Button to the Edison

The doorbell is a very simple switch, and works great with the breakout board. By utilizing node.js we have a very powerful trigger to setup a string of commands. In this case, the a button press starts three APIs to the TouchTunes Jukebox system: Login, Check-in, and Queue a song. First, lets make sure the Edison is wired correctly.
A) Connect the button alligator clips to digital pin A0 and GND. Solder the alligator clips or other wires in a concise, and length-appropriate setup to ensure it works with the jacket

B) Connect the Led light to 5V and GND to initiate the ‘on’ glow. Puncture a small hole in the jacket to allow the light to shine through.

Step 6: Uploading the Software

The XDK development environment allows for multiple, mainstream languages (Javascript), that certainly make it easy to create your project. In our case, we decided to utilize Node.JS to utilize the simple on/off to control the Edison board. In simple terms the following string of events takes place from a system perspective:

Clicking the button invoke a string of Web API queries, powered by the persistent WiFi connection, that create the functional magic of playing your favorite song. These API queries are not limited to controlling a jukebox, but can have many other uses, such as
1) Check-in on Foursquare
2) Order an Uber car, based on day-parting
3) Signal for a food vendor at a sporting event
4) Home automation.

The code below showcases the software utilized, and how you can manipulate the code to provide other functionality for this ‘smart jacket’. The team aims to remotely deploy new code based on GPS, time, and applicable sponsor. This is just the beginning. For this codebase, we utilized a free developer account you can sign up for at developer.touchtunes.com. Here, we found our favorite pub, The Brooklyn Tavern, and our favorite Song: TigerLily by the band Luna. Utilizing the TouchTunes APIs you are able to determine these details, plus utilize their tools for troubleshooting. Keep in mind, you need to sign up for your own key to access the Jukebox control – email api@touchtunes.com for added APIs , such as the available VIP program.


Code Utilized:

/*jslint node:true, vars:true, bitwise:true, unparam:true *

*jshint unused:true *

*global */

var request = require('request');

var mraa = require('mraa'); //require mraa

console.log('MRAA Version: ' + mraa.getVersion()); //write the mraa version to the

console

// var myOnboardLed = new mraa.Gpio(13); //LED hooked up to digital pin 13 (or built in

pin on Galileo Gen1 & Gen2)

// myOnboardLed.dir(mraa.DIR_OUT); //set the gpio direction to output

var loginKey;

//request.post({

// url: "https://dev.touchtunes.com/v2/VIP_AccessToken",

// form: {

// grant_type: 'password',

// username: 'YOURUSERNAME,

// password: 'YOURPASSWORD',

// oauth_consumer_key: 'ENTERKEYHERE'

// }

//}, function(error, response, body) {

//

// if (error) {

// console.log(error);

// } else {

// loginKey = 'Bearer ' + JSON.parse(body).response.access_token;

// console.log(loginKey);

// }

//});

periodicActivity(); //call the periodicActivity function

function periodicActivity() {

var analogPin0 = new mraa.Aio(0); //setup access analog input Analog pin #0 (A0)

var analogValue = analogPin0.read(); //read the value of the analog pin

if (analogValue >= 1000) {

console.log('pressing Button');

request.post({

url: "https://dev.touchtunes.com/v2/VIP_Access",

form: {

grant_type: 'password',

username: ' YOURUSERNAME ',

password: 'a YOURPASSWORD,

oauth_consumer_key: ' ENTERKEYHERE '

}

}, function(error, response, body) {

if (error) {

console.log(error);

} else {

loginKey = 'Bearer ' + JSON.parse(body).response.access_token;

console.log(loginKey);

request.post({

headers: {

'Authorization': loginKey

},

url: 'https://dev.touchtunes.com/v2/VIP_Access',

form: {

device_id: '2068872'

}

}, function(error, response, body) {

if (error) {

console.error(error);

} else {

request.post({

headers: {

'Authorization': loginKey

},

url:

"https://dev.touchtunes.com/v2/locations/VIP_Access",

form: {

song_id: '44791909',

play_next: '1'

}

}, function(error, response, body) {

if (error) {

console.log(error);

} else {

console.log('success!');

while (analogValue >= 1000) {

//wait for person to release

}

setTimeout(periodicActivity, 1000); //call the indicated function

after 1 second (1000 milliseconds)

}

});

}

});

}

});

} else {

}

setTimeout(periodicActivity, 100); //call the indicated function after 1 second (1000

milliseconds)

}

Step 1: Step 1: Tools and Materials

Jacket Materials

- Generic White Doorbell from Home Depot or similar
- Tailored leather coat, with a high collar or lapel
- Intel Edison module, with WiFi
- Double-ended Crocodile Clips, Alligator clips wire
- Mobile Battery Pack, 4 “AA” Battery Holder (6V)
- 2 Micro USB cords - Bright blue , 5mm Round LED, 20 mA
- WiFi Hotspot, or Internet sharing smartphone Tools
- Computer with Intel XDK Installed - Soldering iron and solder
- Fabric sewing kit
- Leatherman knife or similar, to modify jacket