Adjust the Code

To get ready for connecting to If This Then That we are going to make a slight adjustment to our code.

Disconnect the sensor from your face and use a USB cable to connect the Feather to your computer. Go back to the loop in your code. Comment out the following line so it looks like this:

  // ble.println(sensorValue);

Then uncomment the block of code that follows so it looks like this:

if (sensorValue > threshold && oldSensorValue < threshold) {
    ble.println(sensorValue);
 }
  
oldSensorValue = sensorValue;

Once you've made these changes go ahead and upload the code to the Feather. Unplug the Feather from your computer, connect the battery, and reattach the sensor to your face. 

Create a Feed on Adafruit IO

Log in to Adafruit IO and create a feed for your brow activities.

Adjust MQTT Settings

Open up the Adafruit Bluetooth LE Connect app on your mobile device. Reconnect with the Feather board and open the UART window. This time the sensor values will only appear when the sensor values pass a certain threshold - aka when you raise your eyebrows!

Select the MQTT icon in the upper right.

Configure your first two boxes as follows:

Server

Address: io.adafruit.com

Port: 1833

Publish

UART RX: username/feeds/feedname

Under "Advanced," enter your username and AIO key, which can be found by clicking the key button in the upper right of any of your Dashboards.

Copy your AIO key into an email, file on dropbox, or other easy way to paste it into your device-- copying it from the screen is no fun (unless you love memorizing)!

After you've configured your settings, go ahead and click CONNECT at the top of the page.

You can then check your feed on Adafruit IO to make sure the data is uploading properly.

Create a Recipe on IFTTT

Open your IFTTT account and create a recipe using the Adafruit channel. Use the "Any New Data" trigger and select the appropriate feed.

From there you can select your action. We used Android SMS to send a text message.

Now whenever you raise your eyebrows it will send a 'Sup message to your friend!

This guide was first published on Jan 27, 2016. It was last updated on Mar 08, 2024.

This page (IFTTT Test) was last updated on Jan 21, 2016.

Text editor powered by tinymce.