# Adafruit IO Time Tracking Cube

## Overview

https://www.youtube.com/watch?v=sBJnkPywAMw

## Time Tracking Tasks&nbsp;

It's difficult to remember exactly what time you started work on a project, and when you stopped. Tasks like taking out the dog and brewing a fresh pot of coffee to keep you focused do not count towards your project's "total hours".

![adafruit_io_hero-cube-feathers-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/069/248/medium640/adafruit_io_hero-cube-feathers-2.jpg?1547257353)

## Automate Time-Sheets

You can use Microsoft Excel to track your data using a time-sheet, but manually inputting times and tasks also becomes a task.&nbsp;We're going to build a _different_ way to track your - using a flippable cube.&nbsp;

&nbsp;

&nbsp;

_New task?_ Flip it over._Taking a break?_ Flip it over.&nbsp;_Finished with work for the day?_ Flip it it over!

![adafruit_io_color-flip.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/318/medium640thumb/adafruit_io_color-flip.jpg?1547418595)

![](https://cdn-learn.adafruit.com/assets/assets/000/069/316/medium800/adafruit_io_code-desk.jpg?1547417425)

We'll be connecting the Time Tracking Cube to&nbsp;[Adafruit IO](http://io.adafruit.com/)&nbsp;to collect **metadata** about _when_ the cube was flipped and its orientation.

![adafruit_io_ezgif.com-gif-maker.gif](https://cdn-learn.adafruit.com/assets/assets/000/068/664/medium640thumb/adafruit_io_ezgif.com-gif-maker.jpg?1546550654)

We're also going to create a [Zapier](https://zapier.com) Zap to periodically collect data from this feed and send it to a timesheet we create on Google Sheets.&nbsp;

![adafruit_io_TimeCube_Timesheet_-_Google_Sheets.png](https://cdn-learn.adafruit.com/assets/assets/000/068/670/medium640/adafruit_io_TimeCube_Timesheet_-_Google_Sheets.png?1546625291)

## Adafruit Feather Platform

The Adafruit Feather HUZZAH with ESP8266&nbsp;is an all in one&nbsp;WiFi dev board with built in USB and battery charging.&nbsp;The Adafruit Feather format is easy to use gives you tons of add-ons.&nbsp;The Prop-Maker Wing adds NeoPixel support and sound effects.

![adafruit_io_featherwing-snapon.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/317/medium640thumb/adafruit_io_featherwing-snapon.jpg?1547418381)

## Parts
![](https://cdn-learn.adafruit.com/assets/assets/000/068/986/medium800/adafruit_io_parts.jpg?1547129530)

You'll need the following parts to complete this guide.

The ESP8266 is simple to set up and supported by the Adafruit IO Arduino library.

### Adafruit Feather HUZZAH with ESP8266 - Loose Headers

[Adafruit Feather HUZZAH with ESP8266 - Loose Headers](https://www.adafruit.com/product/2821)
Feather is the new development board from Adafruit, and like its namesake, it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores.

This is the&nbsp; **Adafruit Feather HUZZAH ESP8266** &nbsp;- our take on an...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2821)
[Related Guides to the Product](https://learn.adafruit.com/products/2821/guides)
![Angled shot of black, rectangular WiFi development board.](https://cdn-shop.adafruit.com/640x480/2821-07.jpg)

The Prop-Maker FeatherWing has&nbsp; **_lots_&nbsp;** of options for building either props, or desk-toys. We'll use one feature of the FeatherWing - the LIS3DH Accelerometer. This sensor is perfect for detecting when the cube is tilted in different orientations on the desk.&nbsp;

### Adafruit Prop-Maker FeatherWing

[Adafruit Prop-Maker FeatherWing](https://www.adafruit.com/product/3988)
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. Perfect for fitting into your next prop build! This FeatherWing will unlock the prop-maker inside all of us, with tons of stuff packed in to make sabers & swords, props, toys,...

In Stock
[Buy Now](https://www.adafruit.com/product/3988)
[Related Guides to the Product](https://learn.adafruit.com/products/3988/guides)
![Angled shot of a Adafruit Prop-Maker FeatherWing. ](https://cdn-shop.adafruit.com/640x480/3988-00.jpg)

We'll also use a small Piezo Buzzer to let us know if the cube was tilted, without checking Adafruit IO or the Serial Monitor.

### Piezo Buzzer

[Piezo Buzzer](https://www.adafruit.com/product/160)
Piezo buzzers are used for making beeps, tones and alerts. This one is petite but loud! Drive it with 3-30V peak-to-peak square wave. To use, connect one pin to ground (either one) and the other pin to a square wave out from a timer or microcontroller. For the loudest tones, stay around 4 KHz,...

In Stock
[Buy Now](https://www.adafruit.com/product/160)
[Related Guides to the Product](https://learn.adafruit.com/products/160/guides)
![Bread-board friendly Piezo Buzzer](https://cdn-shop.adafruit.com/640x480/160-01.jpg)

### Part: 8x NeoPixel Stick
quantity: 1
5050 RGB LED NeoPixels
[8x NeoPixel Stick](https://www.adafruit.com/product/1426)

### Part: Feather Female Headers Kit
quantity: 1
12-pin and 16-pin short female headers
[Feather Female Headers Kit](https://www.adafruit.com/product/2940)

### Part: Feather Male Headers Kit
quantity: 1
12-pin and 16-pin male headers
[Feather Male Headers Kit](https://www.adafruit.com/product/3002)

### Part: 3-Pin JST PH Cable
quantity: 1
3-pin JST-PH cable
[3-Pin JST PH Cable](https://www.adafruit.com/product/3894)

![](https://cdn-learn.adafruit.com/assets/assets/000/069/315/medium800/adafruit_io_circuit-test.jpg?1547417404)

## Materials
## Tools

To build your Time Tracking Cube, you'll need access to the following tools. Don't have something listed? Pick it up from the Adafruit shop.

### Part: 3D Printer
quantity: 1
Ultimaker 2+ 3D Printer
[3D Printer](https://www.adafruit.com/product/2673)

### Part: M2.5 x 8mm metric machine screws
quantity: 6
M2.5 x 8mm flat head metric screws
[M2.5 x 8mm metric machine screws](https://www.albanycountyfasteners.com/2-5-MM-x-45-Phillips-Flat-Head-Machine-Screw-p/1011-1002.htm)

![](https://cdn-learn.adafruit.com/assets/assets/000/069/063/medium800thumb/adafruit_io_cube-flip-alt.jpg?1547226027)

# Adafruit IO Time Tracking Cube

## 3D Printing

## 3D Printed Parts

Parts are designed to be 3D printed with FDM based machines. STL files are oriented to print "as is". Machines with dual extrusion or single extrusion setups are listed below with parts name and description. Parts require tight tolerances that might need adjusting slice setting. Reference the suggested settings below.

![adafruit_io_3d-parts-angle.jpg](https://cdn-learn.adafruit.com/assets/assets/000/068/989/medium640/adafruit_io_3d-parts-angle.jpg?1547134328)

## Parts List

Use the parts list to reference filenames and extruder versions.&nbsp;

- **ttc-box.stl** – cube frame (single extrusion)
- **ttc-box-A.stl** – cube frame (dual extrusion)
- **ttc-box-B.stl** – clear panels (dual extrusion)
- **ttc-side.stl** – 3x quantity symmetrical side panels
- **ttc-top-side.stl** – Install NeoPixel to this panel
- **ttc-bot-side.stl** – Install to cover to this panel
- **ttc-back-side.stl** – Panel with USB port
- **ttc-cover.stl –** Install Feather HUZZAH to this panel

## Tap Mounting Holes

I used a set of screw taps to create threads in the various mounting holes. This greatly improves fastening screws. of the A mix of metric sizes are used here. M2.5 taps for the various mounts.

## Parts Assembly

The Feather is secured to the bottom cover using M2.5 x 8mm flat head machine screws. The bottom cover snap fits onto the bottom of the cube. Several panels are snap fitted into the openings.

![adafruit_io_cad-cube.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/077/medium640thumb/adafruit_io_cad-cube.jpg?1547231340)

## CURA Slicing Software

Rotate to orient the cube&nbsp;so the microUSB opening facing the top – This orientation is best for 3D printing support free.

&nbsp;

Tool heads equipped for dual extrusion can be setup using the **ttc-box-A.stl** and **ttc-box-B.stl** named&nbsp;parts. Use a transparent filament for part B and a darker color for part A.

![adafruit_io_cura-slice.jpg](https://cdn-learn.adafruit.com/assets/assets/000/069/054/medium640/adafruit_io_cura-slice.jpg?1547218872)

[Download CAD Parts](https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/Time_Tracking_Cube)
## Design Source Files

The enclosure assembly was designed in Fusion 360.&nbsp;This can be downloaded in different formats like STEP, SAT and more. Electronic components like the board, displays, connectors and more can be downloaded from our&nbsp;[Fusion 360 CAD parts github repo](https://github.com/adafruit/Adafruit_CAD_Parts).

[Download Adafruit CAD Parts](https://github.com/adafruit/Adafruit_CAD_Parts)
# Adafruit IO Time Tracking Cube

## Wiring

## Circuit&nbsp;Diagram

This provides a visual reference for wiring of the components. They aren't true to scale, just meant to be used as reference. This diagrams was created using [Fritzing software](http://fritzing.org/download/).

![adafruit_io_circuit-diagram.jpg](https://cdn-learn.adafruit.com/assets/assets/000/069/006/medium640/adafruit_io_circuit-diagram.jpg?1547145886)

The FeatherWing performs all of the heavy lifting. But we are going to&nbsp; **solder a low-cost piezo buzzer&nbsp;** to the Prop-Maker FeatherWing.

**Connect one end of the a piezo buzzer** (it doesn't matter which one) to the **SW** pin and the other end to the **GND** pin.

Three wires are needed for connecting the 8x NeoPixel stick to the Prop-Maker FeatherWing.

- **DIN** from NeoPixel to Prop-Maker NeoPixel port
- **GND** from NeoPixel to Prop-Maker&nbsp;NeoPixel port
- **5VDC** from NeoPixel to Propmaker&nbsp;NeoPixel port

## Powering

The Adafruit Feather can be powered via USB. Use a micro USB cable and connect to a 5V USB battery pack or wall adapter.

## Install Prop-Maker Wing Headers

Start by fitting the 12 and 16 pin headers onto the bottom of the Prop-Maker FeatherWing PCB with the short ends going into the pins. Solder all of the pins. I suggest using a breadboard to help keep the pins in place while soldering.

## Install Piezo to Prop-Maker

Trim the legs of the piezo short. Fit the pins from the piezo onto the SWITCH and ground (GND) pins on the Prop-Maker FeatherWing. Flip the PCB over and solder the pins in place.

## Install HUZZAH Headers

Use 12-pin and 16-pin female headers on the Adafruit HUZZAH ESP8266. These are installed on top of the PCB. To make soldering easier, I suggest installing the headers onto the Prop-Maker – This will keep the female headers in place while soldering. Solder the pins from the female headers.

## NeoPixel Wiring

Cut the JST cable so the wire length is about 85mm (3.3in). Using wire stripper, remove a bit of insulation from the tips of each wire. Apply a bit of solder to the exposed strands&nbsp; of wire – This helps prevent the wires from fraying. Tin the **DIN** , **5+** and **GND** pads on the NeoPixel PCB with a bit of solder. Solder the wires from the JST cable to the pads on the NeoPixel PCB.

## Snap-On FeatherWing

Line up the pins from the Feather HUZZAH ESP8266 with the Prop-Maker FeatherWing. Press fit the headers together so they're fully seated.

![adafruit_io_featherwing-snapon.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/005/medium640thumb/adafruit_io_featherwing-snapon.jpg?1547144694)

## Test Circuit

Plug in the JST cable from the NeoPixel into the port on the Prop-Maker FeatherWing. Connect micro USB cable to your computer or powered hub to power the circuit.

![adafruit_io_neopixel-featherwing.jpg](https://cdn-learn.adafruit.com/assets/assets/000/069/004/medium640/adafruit_io_neopixel-featherwing.jpg?1547144676)

# Adafruit IO Time Tracking Cube

## Assembly

## Install NeoPixel to Panel

Use two M2.25 x 8mm flat head machine screws to secure the NeoPixel stick PCB to the standoffs on the top panel. Tap the mounting holes on the PCB for a better fitting. Insert and fasten the screws into the mounting holes. Place the PCB over the standoffs with the holes lined up with the standoffs. Hold PCBin place while fastening the screws.

## Install HUZZAH to Panel

Use four M2.5 x 8mm flat head machine screws to secure the Feather PCB to the standoffs on the bottom cover. Place the Feather PCB over the standoffs and line up the mounting holes. Insert and fasten the screws to secure the PCB to the bottom cover.

## Install Panels to Cube

Get the cube and the panels ready! The side panels are printed in a different color to distinguish which side will trigger the timer.

![adafruit_io_cube-panels-preinstall.jpg](https://cdn-learn.adafruit.com/assets/assets/000/069/031/medium640/adafruit_io_cube-panels-preinstall.jpg?1547161546)

## Bottom Panel

Starting with the bottom cover panel, orient the piece so the micro USB port on the Feather is lined up with the square cut out on the cube. Insert the cover through the opening and click the edges into the nubs to secure it closed.

![adafruit_io_cube-bot-install.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/032/medium640thumb/adafruit_io_cube-bot-install.jpg?1547161570)

## Top Panel

The panel with the NeoPixel stick is installed in the opening directly above the Feather HUZZAH PCB. Insert the lip of the panel into the opening at an angle and press the rest of the edges through until they click into place.

![adafruit_io_cube-top-install.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/033/medium640thumb/adafruit_io_cube-top-install.jpg?1547161586)

## Connect JST

Grab the JST cable from the NeoPixel and plug it into the Prop-Maker FeatherWing.

![adafruit_io_cube-jst-install.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/034/medium640thumb/adafruit_io_cube-jst-install.jpg?1547161606)

## Back Panel

Orient the back panel with the micro USB port and press fit the lip into the opening.

![adafruit_io_cube-back-install.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/035/medium640thumb/adafruit_io_cube-back-install.jpg?1547161624)

## Front Panel

Repeat the same snap fitting procedure to the front facing panel. Use both hands to slightly flex the opening and firmly press fit edges through.&nbsp;&nbsp;

![adafruit_io_cube-front-install.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/036/medium640thumb/adafruit_io_cube-front-install.jpg?1547161643)

## Task Panels

Now it's time to install the special task panels for time tracking. Use stickers, vinyl decals, or different colored parts to tell the tasks apart. Sticky note or label for something with more legibility.&nbsp;&nbsp;

![adafruit_io_cube-sides-install.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/037/medium640thumb/adafruit_io_cube-sides-install.jpg?1547161658)

## Assembled Cube

Take a moment to inspect the panels and make any necessary adjustments. If everything is as expected, congrats! The time tracking poly cube is fully assembled and ready to log your data!

![adafruit_io_cube-assembled.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/039/medium640thumb/adafruit_io_cube-assembled.jpg?1547162003)

# Adafruit IO Time Tracking Cube

## Adafruit IO Setup

If you do not already have an Adafruit IO account set up, head over to [io.adafruit.com](http://io.adafruit.com/) to link your Adafruit.com account to Adafruit IO.

We need to create a new feed to hold data for the cube's current face (its orientation). Navigate to the [feeds page](https://io.adafruit.com/feeds) on Adafruit IO. Then click **Actions&nbsp;-\> Create New Feed** , and name this feed **cubeorientation**.&nbsp;

- If you do not already know how to create a feed, head over to [Adafruit IO Basics: Feeds](https://learn.adafruit.com/adafruit-io-basics-feeds).

![](https://cdn-learn.adafruit.com/assets/assets/000/068/873/medium800/adafruit_io_cubetask.png?1546960499)

We're also going to need our Adafruit IO username and our secret API key.

Navigate to your profile and click the **View AIO Key** button to retrieve them. Write them down in a safe place, we'll need them for later.

![](https://cdn-learn.adafruit.com/assets/assets/000/062/541/medium800thumb/3d_printing_adafruit_io_username_and_password.jpg?1537910337)

Now that Adafruit IO is set up, let's move on to setting up our Feather HUZZAH ESP8266 with the Prop-Maker Wing.&nbsp;

# Adafruit IO Time Tracking Cube

## Zapier Setup

![](https://cdn-learn.adafruit.com/assets/assets/000/068/661/medium800/adafruit_io_Dashboard___Zapier.png?1546549711 The Zap we'll make for the Time Tracking Cube.)

Using [Zapier](https://zapier.com) with Adafruit IO allows you to automate tasks on the Internet with your data, like writing to Google Sheets or sending a Tweet.

## Linking Adafruit IO and Zapier

You'll want to first link Zapier with your Adafruit IO Account.

Zapier for Adafruit IO is currently not listed on the Zapier Integrations page (we need 10 active users to make it public), **[you can sign up for it using this invite link](https://zapier.com/platform/public-invite/6748/16d4128bd956bb87a1c9c723818c2243/).**

After signing up for Zapier and linking your Adafruit IO account, you'll need to create a [Google Sheets](https://docs.google.com) account if you haven't already.

## Google Sheets Setup

We'll want to create a spreadsheet to hold all the data from the Time Tracking Cube.&nbsp;

Navigate to the [Google Sheets Homepage](https://docs.google.com/spreadsheets),&nbsp; **Click Start a New Spreadsheet**

![adafruit_io_Google_Sheets.png](https://cdn-learn.adafruit.com/assets/assets/000/068/652/medium640/adafruit_io_Google_Sheets.png?1546548496)

On the Spreadsheet, **make three row headers** :&nbsp;

- **Task**
- **Timestamp**
- **Minutes Spent on Task**

These three columns will hold the _metadata_ from the Adafruit IO feed created in the previous step.

![](https://cdn-learn.adafruit.com/assets/assets/000/069/325/medium800/adafruit_io_TimeCube_Timesheet_-_Google_Sheets.png?1547483012)

## Setting up a Zap for Google Sheets
Next, we're create a **Zap**. A Zap is a combination of a _trigger_ (like an Adafruit IO Feed receiving new data) and an _action_ (like sending a Tweet or writing to a Spreadsheet).&nbsp;

To do this, [**navigate to the Zapier Dashboard**](https://zapier.com/app/dashboard) and **click&nbsp;Make a Zap!**

![](https://cdn-learn.adafruit.com/assets/assets/000/068/642/medium800/adafruit_io_Dashboard___Zapier.png?1546546936)

You'll be prompted to choose a trigger app. From the dropdown, select the latest version of Adafruit IO.&nbsp;

&nbsp;

Next, you'll want a trigger. Select&nbsp; **Get Feed Data** , which triggers on new feed data.&nbsp;

![adafruit_io_Edit_a_Step___Zapier.png](https://cdn-learn.adafruit.com/assets/assets/000/068/643/medium640/adafruit_io_Edit_a_Step___Zapier.png?1546547179)

![adafruit_io_Edit_a_Step___Zapier_2.png](https://cdn-learn.adafruit.com/assets/assets/000/068/644/medium640/adafruit_io_Edit_a_Step___Zapier_2.png?1546547195)

Next, **select your Adafruit IO Account** (or connect it if not done already).

&nbsp;

On the Set Up Options step, **Select the&nbsp;Orientation Feed** &nbsp;from the dropdown (if you have a&nbsp;_lot&nbsp;_of feeds - you can search for it).

&nbsp;

Finally, **select a data sample** (if the feed is newly created with no data, these won't exist yet).

![adafruit_io_Edit_a_Step___Zapier_4.png](https://cdn-learn.adafruit.com/assets/assets/000/068/645/medium640/adafruit_io_Edit_a_Step___Zapier_4.png?1546547448)

![adafruit_io_Edit_a_Step___Zapier_3.png](https://cdn-learn.adafruit.com/assets/assets/000/068/646/medium640/adafruit_io_Edit_a_Step___Zapier_3.png?1546547477)

![adafruit_io_Edit_a_Step___Zapier_5.png](https://cdn-learn.adafruit.com/assets/assets/000/068/647/medium640/adafruit_io_Edit_a_Step___Zapier_5.png?1546547633)

Next, we're going to set up the action. In this case, it'll be writing the value of the feed, and time which the data was sent to the feed, to a Google Sheet.

&nbsp;

From&nbsp; **Choose an Action App** , **select** &nbsp; **Google Sheets**.

&nbsp;

From&nbsp; **Select Google Sheets Action** , **select** &nbsp; **Create Spreadsheet Row**.&nbsp;

![adafruit_io_Edit_a_Step___Zapier_6.png](https://cdn-learn.adafruit.com/assets/assets/000/068/648/medium640/adafruit_io_Edit_a_Step___Zapier_6.png?1546547831)

![adafruit_io_Edit_a_Step___Zapier_7.png](https://cdn-learn.adafruit.com/assets/assets/000/068/649/medium640/adafruit_io_Edit_a_Step___Zapier_7.png?1546547876)

 **Click&nbsp;Connect an Account&nbsp;** to link your Google Sheets Account (the same as your Google Account) with Zapier.&nbsp;

![adafruit_io_Edit_a_Step___Zapier_8.png](https://cdn-learn.adafruit.com/assets/assets/000/068/650/medium640/adafruit_io_Edit_a_Step___Zapier_8.png?1546547999)

From the&nbsp;Spreadsheet dropdown, **select the spreadsheet** we made earlier from&nbsp; **Worksheet**.&nbsp;Zapier will automatically load in the column names.

&nbsp;

**Select the Timestamp&nbsp;column**.

&nbsp;

From the dropdown, **select** &nbsp; **Created At** as the data values to bring in.&nbsp;

![adafruit_io_Edit_a_Step___Zapier_9.png](https://cdn-learn.adafruit.com/assets/assets/000/068/653/medium640/adafruit_io_Edit_a_Step___Zapier_9.png?1546548765)

![adafruit_io_Edit_a_Step___Zapier_9.png](https://cdn-learn.adafruit.com/assets/assets/000/068/654/medium640/adafruit_io_Edit_a_Step___Zapier_9.png?1546548886)

From the Cube Orientation column dropdown, **select the&nbsp;value&nbsp;field**.&nbsp;

&nbsp;

**Click Continue&nbsp;** to finish setting up the action.

![adafruit_io_Edit_a_Step___Zapier_10.png](https://cdn-learn.adafruit.com/assets/assets/000/068/655/medium640/adafruit_io_Edit_a_Step___Zapier_10.png?1546549210)

![adafruit_io_Edit_a_Step___Zapier_11.png](https://cdn-learn.adafruit.com/assets/assets/000/068/656/medium640/adafruit_io_Edit_a_Step___Zapier_11.png?1546549304)

Since we'll want to send the minutes&nbsp; **and** the task as Adafruit IO data, we'll need to get clever.&nbsp;

&nbsp;

Each value sent to Adafruit IO has associated _metadata_ - such as the time it was sent, and the ID of the data point.&nbsp;To send our timer in the same data point as our task, we'll be using the latitude metadata.&nbsp;

&nbsp;

From Zapier, **select Minutes Spent on Task**. Scroll down to&nbsp; **select&nbsp;Lat**.

![adafruit_io_TimeCube_Task___Zapier_Mins.png](https://cdn-learn.adafruit.com/assets/assets/000/069/237/medium640/adafruit_io_TimeCube_Task___Zapier_Mins.png?1547242752)

Another piece of metadata which we'll use in our spreadsheet is the timestamp - which is when the data was sent to Adafruit IO. This lets us keep track of our tasks and organize them by data or time.

&nbsp;

From Zapier, **select Timestamp**. Scroll down to&nbsp; **select&nbsp;Created At**

![adafruit_io_TimeCube_Task___Zapier_Timestamp.png](https://cdn-learn.adafruit.com/assets/assets/000/069/239/medium640/adafruit_io_TimeCube_Task___Zapier_Timestamp.png?1547245169)

To test if the sheet was set up correctly, **click Send Test to Google Sheets**.

&nbsp;

If everything was set up correctly, you'll see an updated row on the Google Sheet you've created earlier.&nbsp;

![adafruit_io_Edit_a_Step___Zapier_12.png](https://cdn-learn.adafruit.com/assets/assets/000/068/658/medium640/adafruit_io_Edit_a_Step___Zapier_12.png?1546549469)

![adafruit_io_TimeCube_Timesheet_-_Google_Sheets_and_Edit_a_Step___Zapier.png](https://cdn-learn.adafruit.com/assets/assets/000/068/659/medium640/adafruit_io_TimeCube_Timesheet_-_Google_Sheets_and_Edit_a_Step___Zapier.png?1546549487)

Finally, **give your zap a name** and **turn it on**.

![](https://cdn-learn.adafruit.com/assets/assets/000/068/660/medium800thumb/adafruit_io_turn_zap_on.jpg?1546549621)

Next, we'll move onto coding up the Time Cube.&nbsp;

# Adafruit IO Time Tracking Cube

## Arduino Setup

First, get the Feather Huzzah ESP8266 set up with the Arduino IDE and Adafruit IO.

- If you haven't yet set up your ESP8266 for use with Adafruit IO and the Arduino IDE,&nbsp;[follow along with this guide](https://learn.adafruit.com/adafruit-io-basics-esp8266-arduino/arduino-io-library). The setup only needs to be performed once.

## Installing Libraries
We'll want to use the **LIS3DH** sensor on the Prop-Maker FeatherWing. To do this, we'll install the&nbsp; **Adafruit LIS3DH&nbsp;** library from the Library Manager.

![](https://cdn-learn.adafruit.com/assets/assets/000/069/328/medium800/adafruit_io_Library_Manager_LIS.png?1547484909)

We'll also want to control the NeoPixel strip. From the library manager, install the&nbsp; **Adafruit NeoPixel&nbsp;** library.

![](https://cdn-learn.adafruit.com/assets/assets/000/069/329/medium800/adafruit_io_Library_Manager_Neopixel.png?1547484938)

The code for this example is contained within the&nbsp; Adafruit IO Arduino Library (make sure your library version is 2.7.22 or later).

From the Arduino IDE, navigate to&nbsp; **File-\>Examples-\>Adafruit IO Arduino-\>adafruitio\_24\_zapier**

![](https://cdn-learn.adafruit.com/assets/assets/000/069/330/medium800/adafruit_io_24_zapier_selection.png?1547485010)

Next, we'll perform the network configuration required for this sketch.

# Adafruit IO Time Tracking Cube

## Arduino Network Config

To configure the network settings, click on the **config.h** tab in the sketch. You will need to set your Adafruit IO username in the **IO_USERNAME** define, and your Adafruit IO key in the **IO_KEY** define.

![](https://cdn-learn.adafruit.com/assets/assets/000/039/317/medium800/adafruit_io_03_config.png?1487185264)

## WiFi Config

WiFi is enabled by default in **config.h** so if you are using one of the supported WiFi boards, you will only need to modify the **WIFI_SSID** and **WIFI_PASS** options in the **config.h** tab.

![](https://cdn-learn.adafruit.com/assets/assets/000/039/318/medium800/adafruit_io_04_wifi.png?1487185900)

## FONA Config

If you wish to use the FONA 32u4 Feather to connect to Adafruit IO, you will need to first comment out the WiFi support in **config.h**

![](https://cdn-learn.adafruit.com/assets/assets/000/039/319/medium800/adafruit_io_05_wifi_disable.png?1487186164)

Next, remove the comments from both of the FONA config lines in the FONA section of **config.h** to enable FONA support.

![](https://cdn-learn.adafruit.com/assets/assets/000/039/320/medium800/adafruit_io_06_fona.png?1487186409)

## Ethernet Config

If you wish to use the Ethernet Wing to connect to Adafruit IO, you will need to first comment out the WiFi support in **config.h**

![](https://cdn-learn.adafruit.com/assets/assets/000/039/321/medium800/adafruit_io_05_wifi_disable.png?1487186577)

Next, remove the comments from both of the Ethernet config lines in the Ethernet section of **config.h** to enable Ethernet Wing support.

![](https://cdn-learn.adafruit.com/assets/assets/000/039/322/medium800/adafruit_io_07_ethernet.png?1487186729)

Next, we will look at how the example sketch works.

# Adafruit IO Time Tracking Cube

## Code

Let's take a quick dip into the code powering the Time Tracking Cube. If you're interested in using an accelerometer to send data to Adafruit IO, this code can serve as a good jumping off point.

Within the `loop()`, a normalized sensor reading is taken from the accelerometer and we'll call a function to update the timer.

```auto
  // Update the timer
  updateTime();

  // Get a normalized sensor reading
  sensors_event_t event;
  lis.getEvent(&amp;event);
```

Then, the face orientation is detected within a conditional statement. For example, if the cube is tilted to the&nbsp;_left,&nbsp;_we'll detect it by querying the accelerometer's acceleration along the X axis:

```auto
      // Detect cube face orientation
  if (event.acceleration.x &gt; 9 &amp;&amp; event.acceleration.x &lt; 10) // left-side up
  {
    //Serial.println("Cube TILTED: Left");
    cubeState = 1;
  }
  
```

We don't want the cube to register a right-side tilt if we've previously tilted it to the right. To do this, we'll compare the cube's state to its previous state.

```auto
  // return if the orientation hasn't changed
  if (cubeState == prvCubeState)
    return;
```

Then, we'll send the cube's previous task and the time spent on that task to Adafruit IO based off of the cube's orientation we detected earlier ([using a switch-case statement](https://www.arduino.cc/reference/en/language/structure/control-structure/switchcase/)). On this new task, the NeoPixel strip is updated, the cube will play a tone, and we'll reset the timer. The idle state (case 3) will play a tone and update the NeoPixels, but it won't send to Adafruit IO.

```auto
  // Send to Adafruit IO based off of the orientation of the cube
  switch (cubeState)
  {
  case 1:
    Serial.println("Switching to Task 1");
    // update the neopixel strip
    updatePixels(50, 0, 0);
    // play a sound
    tone(PIEZO_PIN, 650, 300);
    Serial.print("Sending to Adafruit IO -&gt; ");
    Serial.println(taskTwo);
    cubetask-&gt;save(taskTwo, minutes);
    // reset the timer
    minutes = 0;
    break;
  case 2:
    Serial.println("Switching to Task 2");
    // update the neopixel strip
    updatePixels(0, 50, 0);
    // play a sound
    tone(PIEZO_PIN, 850, 300);
    Serial.print("Sending to Adafruit IO -&gt; ");
    Serial.println(taskOne);
    cubetask-&gt;save(taskOne, minutes);
    // reset the timer
    minutes = 0;
    break;
  case 3:
    updatePixels(0, 0, 50);
    tone(PIEZO_PIN, 950, 300);
    break;
  }
```

## Using the Time Tracking Cube
Upload the code to your Feather Huzzah. Then, open the Arduino Serial Monitor&nbsp;(**Tools -\> Serial Monitor)**.

```auto
Adafruit IO Time Tracking Cube
LIS3DH found!
Pixels init'd
Connecting to Adafruit IOAdafruitIO::connect()
.
Adafruit IO connected.

```

![](https://cdn-learn.adafruit.com/assets/assets/000/069/338/medium800thumb/adafruit_io_cube-flip-alt.jpg?1547490651)

Keep the serial monitor open and&nbsp;_tilt the cube the left_. The cube will glow&nbsp; **red&nbsp;** and the serial monitor will print out:

`Switching to Task 1`  
`Sending to Adafruit IO -> Write Code`

&nbsp;

Tilting the cube to the right will make it switch to the second task and the cube will glow&nbsp; **green**.

![adafruit_io_cube-flip-alt.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/332/medium640thumb/adafruit_io_cube-flip-alt.jpg?1547486757)

Flipping the cube will change the&nbsp;_value_&nbsp;in real-time.

&nbsp;

You can check&nbsp; that the task has been sent to Adafruit IO by navigating to the feed on the Adafruit IO website. You should see the&nbsp;_value_&nbsp;set to the&nbsp;previous&nbsp;task.&nbsp;

![adafruit_io_feed_change.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/333/medium640thumb/adafruit_io_feed_change.jpg?1547487078)

Next, we'll want to check that Zapier is working properly.

&nbsp;

**Navigate to the Task History Page on Zapier**. If the Zap executed successfully, it'll display&nbsp;_success_&nbsp;under its status.

&nbsp;

Clicking the task will show you which data was found in Adafruit IO and what was written to the Google Sheet row.

![adafruit_io_Task_History___Zapier.png](https://cdn-learn.adafruit.com/assets/assets/000/069/334/medium640/adafruit_io_Task_History___Zapier.png?1547487541)

![adafruit_io_Task_History_000932fe-6de8-ad73-b1b6-2509bb81f180___Zapier.png](https://cdn-learn.adafruit.com/assets/assets/000/069/335/medium640/adafruit_io_Task_History_000932fe-6de8-ad73-b1b6-2509bb81f180___Zapier.png?1547487615)

### 

The time cube zap runs every 15 minutes, grabbing the latest data from the Adafruit IO feed.

If the Zap worked properly, you'll see the spreadsheet updated with new values every 15 minutes.

![](https://cdn-learn.adafruit.com/assets/assets/000/069/337/medium800/adafruit_io_TimeCube_Timesheet_-_Google_Sheets_and_adafruitio_24_zapier___Arduino_1_8_7.png?1547487816)

## Taking it Further

Now that we have the time cube sending two tasks to Adafruit IO - the code can be extended to sending more tasks to Adafruit IO. _How many tasks are possible?_ The time cube has _six_ sides - so, _six_ unique tasks are possible.&nbsp;

We're also using the Prop-Maker FeatherWing for this project, which opens up more possibilities. You can take this project further by adding in a button (possibly along one the back face of the cube) to power-down the cube when it's not in use.

What about if you have more than six tasks? The Prop-Maker FeatherWing has breakouts for an external switch, which you can use as a mode-selector.&nbsp;

## Code
https://github.com/adafruit/Adafruit_IO_Arduino/blob/master/examples/adafruitio_24_zapier/adafruitio_24_zapier.ino


## Featured Products

### Adafruit Feather HUZZAH with ESP8266 - Loose Headers

[Adafruit Feather HUZZAH with ESP8266 - Loose Headers](https://www.adafruit.com/product/2821)
Feather is the new development board from Adafruit, and like its namesake, it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores.

This is the&nbsp; **Adafruit Feather HUZZAH ESP8266** &nbsp;- our take on an...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2821)
[Related Guides to the Product](https://learn.adafruit.com/products/2821/guides)
### Adafruit Prop-Maker FeatherWing

[Adafruit Prop-Maker FeatherWing](https://www.adafruit.com/product/3988)
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. Perfect for fitting into your next prop build! This FeatherWing will unlock the prop-maker inside all of us, with tons of stuff packed in to make sabers & swords, props, toys,...

In Stock
[Buy Now](https://www.adafruit.com/product/3988)
[Related Guides to the Product](https://learn.adafruit.com/products/3988/guides)
### Piezo Buzzer

[Piezo Buzzer](https://www.adafruit.com/product/160)
Piezo buzzers are used for making beeps, tones and alerts. This one is petite but loud! Drive it with 3-30V peak-to-peak square wave. To use, connect one pin to ground (either one) and the other pin to a square wave out from a timer or microcontroller. For the loudest tones, stay around 4 KHz,...

In Stock
[Buy Now](https://www.adafruit.com/product/160)
[Related Guides to the Product](https://learn.adafruit.com/products/160/guides)
### NeoPixel Stick - 8 x 5050 RGB LED with Integrated Drivers

[NeoPixel Stick - 8 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1426)
Make your own little LED strip arrangement with this stick of NeoPixel LEDs. We crammed 8 of the tiny 5050 (5mm x 5mm) smart RGB LEDs onto a PCB with mounting holes and a chainable design. Use only one microcontroller pin to control as many as you can chain together! Each LED is addressable as...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1426)
[Related Guides to the Product](https://learn.adafruit.com/products/1426/guides)
### Short Headers Kit for Feather - 12-pin + 16-pin Female Headers

[Short Headers Kit for Feather - 12-pin + 16-pin Female Headers](https://www.adafruit.com/product/2940)
These two&nbsp; **Short** &nbsp; **Female&nbsp;Headers** &nbsp;alone are, well, lonely. But pair them with any of our&nbsp;[Feather](https://www.adafruit.com/categories/777)&nbsp;boards and you're in business!

These headers are particularly cute and...

In Stock
[Buy Now](https://www.adafruit.com/product/2940)
[Related Guides to the Product](https://learn.adafruit.com/products/2940/guides)
### Short Feather Male Headers - 12-pin and 16-pin Male Header Set

[Short Feather Male Headers - 12-pin and 16-pin Male Header Set](https://www.adafruit.com/product/3002)
These two&nbsp; **Short** &nbsp; **Male&nbsp;Headers** &nbsp;alone are, well, lonely. But pair them with any of our&nbsp;[Feather](https://www.adafruit.com/categories/777)&nbsp;boards and you're in business!

<p...></p...>In Stock
[Buy Now](https://www.adafruit.com/product/3002)
[Related Guides to the Product](https://learn.adafruit.com/products/3002/guides)
### STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm

[STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm](https://www.adafruit.com/product/3894)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" female header sockets on the end. We're carrying these to match up with our Hallowing, for extending and connecting sensors or LEDs - and the wires are even color coded!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3894)
[Related Guides to the Product](https://learn.adafruit.com/products/3894/guides)
### Assembled Adafruit Prop-Maker FeatherWing

[Assembled Adafruit Prop-Maker FeatherWing](https://www.adafruit.com/product/4145)
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. Perfect for fitting into your next prop build! This FeatherWing will unlock the prop-maker inside all of us, with tons of stuff packed in to make sabers & swords, props, toys,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4145)
[Related Guides to the Product](https://learn.adafruit.com/products/4145/guides)

## Related Guides

- [Adafruit Feather HUZZAH ESP8266](https://learn.adafruit.com/adafruit-feather-huzzah-esp8266.md)
- [Adafruit Prop-Maker FeatherWing](https://learn.adafruit.com/adafruit-prop-maker-featherwing.md)
- [Adafruit IO Home: Security ](https://learn.adafruit.com/adafruit-io-home-security.md)
- [micro:bit Lesson 3. NeoPixels with micro:bit](https://learn.adafruit.com/micro-bit-lesson-3-neopixels-with-micro-bit.md)
- [Automatic Twitch On-Air Sign](https://learn.adafruit.com/automatic-twitch-on-air-sign.md)
- [DIY ESP8266 Home Security with Lua and MQTT](https://learn.adafruit.com/diy-esp8266-home-security-with-lua-and-mqtt.md)
- [DIY Darksaber Build - 3D Print with PropMaker FeatherWing and BLE](https://learn.adafruit.com/ble-darksaber-propmaker.md)
- [Feather Weather Lamp](https://learn.adafruit.com/feather-weather-lamp.md)
- [Building CircuitPython](https://learn.adafruit.com/building-circuitpython.md)
- [RGB & HSV NeoPixel Dialer](https://learn.adafruit.com/rgb-hsv-neopixel-dialer.md)
- [Playa Festival Bike](https://learn.adafruit.com/playa-festival-bike.md)
- [LED Acrylic Sign](https://learn.adafruit.com/led-acrylic-sign.md)
- [TVA Pruning Baton from Loki](https://learn.adafruit.com/tva-pruning-baton-from-loki.md)
- [MicroPython Hardware: Analog I/O](https://learn.adafruit.com/micropython-hardware-analog-i-o.md)
- [MicroPython Basics: Loading Modules](https://learn.adafruit.com/micropython-basics-loading-modules.md)
- [Capacitive Touch Drum Machine](https://learn.adafruit.com/capacitive-touch-drum-machine.md)
- [MicroPython Hardware: Digital I/O](https://learn.adafruit.com/micropython-hardware-digital-i-slash-o.md)
