# Track Your Treats: Halloween Candy GPS Tracker

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/028/055/medium800/gps_IMG_2673.jpg?1444677012)

So you've got an awesome&nbsp;Halloween costume planned, but do you know the best places to go trick or treating this year? &nbsp;Some houses have great candy while others might stick you with a set of wax teeth or a granola bar--yuck! &nbsp;Wouldn't it be nice to keep a record of the best houses for trick or treating? &nbsp;With this **Track Your Treats GPS Candy Tracker** project you can build a candy container that logs&nbsp;exactly where you found the best Halloween candy. &nbsp;Using the power of the [global positioning system](https://en.wikipedia.org/wiki/Global_Positioning_System)&nbsp;you can optimize&nbsp;your trick or treat route for maximum candy acquisition!

This project uses an Arduino and either a [GPS shield](https://www.adafruit.com/products/1272)&nbsp;or [FONA 808 shield](https://www.adafruit.com/products/2636)&nbsp;to log your trick or treat route. &nbsp;By pressing a button you can note a location as having good candy and view those good candy locations later on a map--great for planning&nbsp;next year's trick or treating route. &nbsp;With the GPS shield your path will be logged to a microSD card and viewed on Google Maps, and with the FONA 808 shield your path will be logged to [Adafruit IO](http://io.adafruit.com/)&nbsp;through the cellular network where a dashboard will display the trick or treating route live as it happens.

Before you get started it will help to be familiar with the following guides:

- [Adafruit Ultimate GPS Shield guide](../../../../adafruit-ultimate-gps-logger-shield/overview)
- [Adafruit FONA 808 Shield guide](../../../../adafruit-fona-808-cellular-plus-gps-shield-for-arduino)
- [Adafruit IO Basics series](../../../../series/adafruit-io-basics)

If you're new to Arduino be sure to read about [getting started](https://www.arduino.cc/en/Guide/HomePage)&nbsp;and [programming a basic blink sketch](../../../../adafruit-arduino-lesson-1-blink/overview)&nbsp;too.

Also note to use the Adafruit IO version of this project you'll need to be part of the Adafruit IO beta. &nbsp;If you don't have access yet check out the [weekly show and tell show](../../../../how-to-get-added-to-the-adafruit-google-plus-show-and-tell-circle/about-show-and-tell)&nbsp;and show off a fun project to show your interest.

Continue on to learn about the hardware used in this project.

# Track Your Treats: Halloween Candy GPS Tracker

## Hardware

# Parts

You'll need the following parts to build this project:

- [Adafruit Metro](https://www.adafruit.com/product/50)&nbsp;(Arduino Uno) - This project is built to work on an Arduino Uno compatible such as the [Adafruit Metro 328P](%20(Arduino%20Uno)). It might work with other Arduinos that are compatible with the ultimate GPS or FONA 808 shields.
- GPS receiver, pick one of the options below:

  - [Ultimate GPS shield](https://www.adafruit.com/products/1272)&nbsp;- This shield will let you save your trick or treating path to the SD card and view it later with Google Maps. &nbsp;This is a simple option that doesn't require any cell or internet service to use with the hardware. &nbsp;You will need a [microSD card](https://www.adafruit.com/product/102)&nbsp;too.
  - [FONA 808 shield](https://www.adafruit.com/products/2636)&nbsp;- This shield will let you log your trick or treating path to Adafruit IO using a GSM&nbsp;cellular phone network. &nbsp;You'll need to have a [2G GSM SIM card and data service](https://www.adafruit.com/product/2505), access to Adafruit IO, a [passive GPS antenna](https://www.adafruit.com/products/2461), a [cellular network antenna](https://www.adafruit.com/products/1991), and a small [LiPo battery](https://www.adafruit.com/products/258).

- [Shield stacking headers](https://www.adafruit.com/products/85)&nbsp;- Not required but will make it a little easier to connect to digital outputs on the shield. &nbsp;If you don't use stacking headers then just solder wires directly to the shield.
- [Momentary button with integrated LED](https://www.adafruit.com/products/1441)&nbsp;- This will be the main interface to the hardware. &nbsp;The LED will tell you if the GPS receiver has a fix and the button is used to mark a location as having good candy.
- 330 ohm resistor - This limits the current through the LED. &nbsp;In most cases you can use any value from around 200 ohms to 500 ohms (but make sure to use one or else you could burn out the LED).
- Candy container - Use an inexpensive plastic container that you can drill a small hole through to mount the button & LED.
- [Power source](https://www.adafruit.com/products/67)&nbsp;- You'll need a small battery power source to power the Arduino when you're trick or treating. &nbsp;I recommend a [9V battery supply](https://www.adafruit.com/products/67)&nbsp;as it's small and will run the hardware for at least a few hours--long enough for your trick or treating run. &nbsp;If you're building the FONA808 version you can actually power everything from the LiPo battery required by the FONA (just move the switch on the shield from the CHRG to RUN position).
- [Wire](https://www.adafruit.com/products/1970)&nbsp;and [soldering tools](https://www.adafruit.com/products/136)&nbsp;- You'll need some wire and soldering tools to connect the button & LED to the Arduino, and assemble the shield. &nbsp;For the button you might consider picking up these [arcade button quick connects](https://www.adafruit.com/product/1152).

# Wiring

Start by assembling your GPS or FONA808 shield and running through its&nbsp;guide to make sure it works:

- [Ultimate GPS Shield Guide](../../../../adafruit-ultimate-gps-logger-shield/overview)
- [FONA808 Shield Guide](../../../../adafruit-fona-808-cellular-plus-gps-shield-for-arduino)

Then wire the button & LED to the Arduino as shown below. &nbsp;Note the shield isn't shown in the diagram below, but you'll want to connect the shield to the Arduino and then wire to the shield as shown.

Also note the diagram shows the LED and button as separate components, however if you're using one of the illuminated buttons recommended in this guide it will have the LED integrated inside of it. &nbsp;There are 4 terminals on the back of this button. &nbsp;The terminal marked with a **+** sign is the anode (positive / longer leg) of the LED and is connected to digital pin #6. &nbsp;The terminal marked with a **-** sign is the cathode (negative / shorter leg) of the LED and is connected to the 330 ohm resistor down to ground. &nbsp;The other two terminals are the momentary button and one should be connected to digital pin #5 and the other to ground.

![](https://cdn-learn.adafruit.com/assets/assets/000/028/000/medium800/gps_track_schematic_bb.png?1444413303)

Here's an example of the hardware using the GPS shield:

![](https://cdn-learn.adafruit.com/assets/assets/000/027/994/medium800/gps_IMG_2665.jpg?1444367238)

And here's an example using the FONA808 shield:

![](https://cdn-learn.adafruit.com/assets/assets/000/027/995/medium800/gps_IMG_2666.jpg?1444367254)

Note that you can tightly zip tie the wires to one of the unused mounting holes on the shield as a form of&nbsp;strain relief. &nbsp;This will help protect the solder joints from taking too much force as the hardware bounces around inside the candy container.&nbsp;

# Assembly

Putting everything together is easy once you've wired up the components. &nbsp;Just drill a hole in the candy&nbsp;container so the button can be mounted in a convenient to reach location.

For the button recommended in this guide you'll want to drill a ~5/8" hole in the container (a [stepped 'christmas tree' drill bit](http://www.harborfreight.com/2-piece-titanium-nitride-coated-high-speed-steel-step-drills-96275.html)&nbsp;works great for drilling clean holes in plastic):

![](https://cdn-learn.adafruit.com/assets/assets/000/027/996/medium800/gps_IMG_2667.jpg?1444367307)

Mount the button in the container:

![](https://cdn-learn.adafruit.com/assets/assets/000/027/997/medium800/gps_IMG_2668.jpg?1444367322)

Connect the button as shown in the diagram above. &nbsp;Remember the **+** lead is the anode of the LED and connects to digital pin #6, and the **-** lead is the cathode which connects through a resistor to ground:

![](https://cdn-learn.adafruit.com/assets/assets/000/027/998/medium800/gps_IMG_2669.jpg?1444367335)

And place the hardware inside the candy container:

![](https://cdn-learn.adafruit.com/assets/assets/000/027/999/medium800/gps_IMG_2670.jpg?1444367730)

That's it, you're ready to load the software for the project!

Note you might consider protecting the Arduino with a case or small cardboard box.

# Track Your Treats: Halloween Candy GPS Tracker

## Software

Once you've assembed the hardware you'll need to load an Arduino sketch for the project. &nbsp;If you're new to Arduino it will help to first familiarize yourself with using it by reading:

- [Arduino - Getting Started](https://www.arduino.cc/en/Guide/Libraries)
- [Arduino Libraries](https://www.arduino.cc/en/Guide/Libraries)

Make sure you have the latest version of the [Arduino IDE](https://www.arduino.cc/en/Main/Software)&nbsp;installed (version 1.6.5 as of the time of this guide writing).

Next you'll need to load a few libraries depending on which version of the project you're building. Remember you can [use the library manager](https://www.arduino.cc/en/Guide/Libraries#toc3)&nbsp;to search for and install these libraries right from the Arduino IDE.

For the **GPS shield** version load these libraries:

- [Adafruit GPS library](https://github.com/adafruit/Adafruit-GPS-Library)

For the **FONA808 shield** version load these libraries:

- [Adafruit FONA library](https://github.com/adafruit/Adafruit_FONA_Library)
- [Adafruit SleepyDog library](https://github.com/adafruit/Adafruit_SleepyDog)
- [Adafruit MQTT library](https://github.com/adafruit/Adafruit_MQTT_Library)

If you already have any of the libraries above installed, make sure to update them to their latest versions. &nbsp;In particular the FONA library needs to be at version **1.2.0** or higher or else it won't work to grab GPS data.

Now&nbsp;download the code this project from its [home on GitHub](https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/Track_Your_Treats).

See the following pages for the GPS shield and the FONA versions of the code.

- **Track\_Your\_Treats** - This is the version of the project that uses the GPS shield to log location data to a SD card.
- **Track\_Your\_Treats\_FONA808** - This is the version of the project that uses the FONA808 shield to log location data to Adafruit IO.

# Track Your Treats: Halloween Candy GPS Tracker

## GPS Shield

# Track Your Treats - GPS Shield

For the GPS shield version of the project load the **Track\_Your\_Treats** sketch by clicking **Download: Project Zip** in the code listing below.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Track_Your_Treats/Track_Your_Treats/Track_Your_Treats.ino

Load the code into the Arduino IDE, you should see something like the following:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/036/medium800/gps_Screenshot_from_2015-10-09_18_30_55.png?1444440668)

You don't need to change anything and are ready to load it on the hardware. &nbsp;However you can skim the **#define** values at the top of the sketch to see values that change how the sketch works.

To load the sketch on the hardware first make sure you have a microSD card inserted in the GPS shield's microSD card holder. &nbsp;The card should 'click' into place and be held firmly by the card holder.

Then connect the Arduino to your computer using a USB cable. &nbsp;In the **Tools -\> Board** menu of the Arduino IDE make sure the **Arduino Uno** board is selected. &nbsp;In the **Tools -\> Port** menu make sure the right serial port is selected for the Arduino (it should say Arduino Uno next to it). &nbsp;Click the **Sketch -\> Upload** command to upload the sketch to the Arduino.

Once the sketch uploads open the **Tools**  **-\> Serial Monitor** to see serial output from the hardware. &nbsp;Make sure the baud is set to **115200** in the lower right corner. &nbsp;You should see serial output similar to the following:

```
Track your Treats - Ultimate GPS Shield
Using log file: GPSLOG24.CSV
Ready!
```

The log file name will automatically increment every time the hardware is powered up or reset. &nbsp;Once the hardware is ready to receive GPS signals it will print **Ready!** and wait for a GPS location fix to be made.

While the hardware is waiting to get a GPS location fix you should see the button LED **blink every second**. &nbsp;Once a location fix is made the LED will **stay solidly lit**. &nbsp;You might need to move the hardware outside where it has a clear view of the sky in order for it to get a GPS fix (it can even take up to 30 minutes in some cases!).

If something goes wrong the button LED will blink quickly (around 5 times a second). &nbsp;Look in the serial monitor to see if an error message is displayed, like for example if a microSD card isn't found and the log file can't be created.

Once the hardware has a GPS fix it will start periodically logging location to the file on the microSD card. &nbsp;Every 15 seconds the location will be logged (but you can change this with the **#defines** at the top of the sketch). &nbsp;

If you press the button the current location will be logged and noted to have good candy, then the LED will **blink 5 times** to acknowledge the button press. &nbsp;Note you can't log locations with the button if the GPS doesn't have a fix (i.e. the button is blinking every second). &nbsp;Wait until the GPS has a fix and the button stays lit solidly before pressing the button.

That's all there is to using the track your treats GPS shield sketch! &nbsp;Walk around and press the button a few times to get sample data, then power down the Arduino and jump to the [Google Maps page](../../../../track-your-treats-halloween-candy-gps-tracker/google-maps)&nbsp;to learn how to view the tracker data.

# Track Your Treats: Halloween Candy GPS Tracker

## FONA

# Track Your Treats - FONA808 & Adafruit IO

For the FONA808 & Adafruit IO version of the project load the **Track\_Your\_Treats\_FONA808** sketch, click **Download: Project Zip** in the code window below.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Track_Your_Treats/Track_Your_Treats_FONA808/Track_Your_Treats_FONA808.ino

Load the sketch in the Arduino IDE,&nbsp;you should see something like the following:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/037/medium800/gps_Screenshot_from_2015-10-09_18_34_28.png?1444440880)

At the top of the sketch are **#define** values which&nbsp;configure how the code will behave. &nbsp;There are a few values you will need to change:

- **FONA\_APN** - Set this to the APN that your cellular network provider requires for accessing their data network. &nbsp;With a Ting SIM card in the US the value "wholesale" is what you want, but for other providers you might need to contact their support to get the value.
- **FONA\_USERNAME** & **FONA\_PASSWORD** - If your cellular network provider requires a username and password to access their data network then put those values here. &nbsp;If they aren't required then just leave the default blank values.
- **AIO\_USERNAME** - This needs to be set to your Adafruit account username, which you can find at [https://accounts.adafruit.com/](https://accounts.adafruit.com/)&nbsp;under the **Username** field.
- **AIO\_KEY** - This needs to be set to your Adafruit IO key, which you can find from the Adafruit IO settings page for your account at&nbsp;[https://io.adafruit.com/settings](https://io.adafruit.com/settings)&nbsp;by clicking **View AIO Keys**.

The other configuration values don't necessarily need to be changed, but it's a good idea to skim them to see what they do.

To load the sketch on the hardware first make sure the hardware is ready. &nbsp;You must have a cellular antenna and GPS antenna connected to the FONA808 shield. &nbsp;In addition you need a LiPoly battery connected to the FONA808 shield so it can power the cellular modem.

Then connect the Arduino to your computer using a USB cable. &nbsp;In the **Tools -\> Board** menu of the Arduino IDE make sure the **Arduino Uno** board is selected. &nbsp;In the **Tools -\> Port** menu make sure the right serial port is selected for the Arduino (it should say Arduino Uno next to it). &nbsp;Click the **Sketch -\> Upload** command to upload the sketch to the Arduino.

Once the sketch uploads open the **Tools**  **-\> Serial Monitor** to see serial output from the hardware. &nbsp;Make sure the baud is set to **115200** in the lower right corner. &nbsp;You should see serial output similar to the following:

```
Track your Treats - FONA808 &amp; Adafruit IO
Initializing FONA....(may take 10 seconds)
FONA is OK
Checking for network...
Disabling GPRS
Enabling GPRS
Connected to Cellular!
MQTT Connected!
```

While the hardware is waiting to get a GPS location fix you should see the button LED **blink every second**. &nbsp;Once a location fix is made the LED will **stay solidly lit**. &nbsp;You might need to move the hardware outside where it has a clear view of the sky in order for it to get a GPS fix (it can even take up to 30 minutes in some cases!).

If something goes wrong the button LED will blink quickly (around 5 times a second). &nbsp;Look in the serial monitor to see if an error message is displayed, like for example a cellular data connection can't be made (check your SIM card and cell account has data access), or if the MQTT/Adafruit IO connect fails (check your AIO username and key values).

Once the hardware has a GPS fix it will start periodically logging location to Adafruit IO. &nbsp;Every 15 seconds the location will be logged (but you can change this with the **#defines** at the top of the sketch).

If you press the button the current location will be logged and noted to have good candy, then the LED will **blink 5 times** to acknowledge the button press. &nbsp;It takes a few moments for the location to be logged after pressing the button so be sure to hold it down until it starts blinking 5 times. &nbsp;Also note you can't log locations with button if the GPS doesn't have a fix (i.e. the button is blinking every second). &nbsp;Wait until the GPS has a fix and the button stays lit solidly before pressing the button.

Once the sketch is running walk around and press the button a few times to get sample data, then jump to the [Adafruit IO page](../../../../track-your-treats-halloween-candy-gps-tracker/adafruit-io)&nbsp;to learn how to view the tracker data on Adafruit IO.

# Track Your Treats: Halloween Candy GPS Tracker

## Google Maps

To view data logged by the GPS shield you can use the [Google My Maps](https://www.google.com/mymaps)&nbsp;service to load and display the CSV data saved to the SD card.

Start by copying the CSV file off of the GPS shield's SD card and moving it to your computer. &nbsp;Then in a web browser access Google My Maps at:

[https://www.google.com/mymaps](https://www.google.com/mymaps)

Note that if you receive an error that you can't access Google My Maps then you probably have a Google apps account and need to ask the administrator of it to [enable Google My Maps](https://www.youtube.com/watch?v=6yICdyFBlIY).

Once Google My Maps loads you'll want to click **Create a new map** :

![](https://cdn-learn.adafruit.com/assets/assets/000/028/028/medium800/gps_Screenshot_from_2015-10-09_17_02_39.png?1444435781)

Now click the blue **Import** &nbsp;link under the new **Untitled layer** in the upper left:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/029/medium800/gps_Screenshot_from_2015-10-09_17_03_04.png?1444435850)

In the dialog that loads click the **Select a file from your computer** button and navigate to the CSV file you copied from the SD card to select it:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/030/medium800/gps_Screenshot_from_2015-10-09_17_03_21.png?1444435906)

Once Google My Maps loads the file it will ask you to choose the columns that contain location information. &nbsp;Make sure only the **latitude** and **longitude** columns are **checked** , then click **Continue** :

![](https://cdn-learn.adafruit.com/assets/assets/000/028/031/medium800/gps_Screenshot_from_2015-10-09_17_04_04.png?1444435943)

In the next dialog select the **note** column as the title for the markers, then click **Finish** :

![](https://cdn-learn.adafruit.com/assets/assets/000/028/032/medium800/gps_Screenshot_from_2015-10-09_17_04_29.png?1444435993)

You should see all of the locations loaded as points on the map, awesome!

Now to change how each type of location is displayed&nbsp;click the **Uniform style** link with the paint roller icon on the layer in the upper left:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/033/medium800/gps_Screenshot_from_2015-10-09_17_07_13.png?1444436071)

Then click the **Uniform style** combo box and change it to the **note** column&nbsp;under **Style by data column** :

![](https://cdn-learn.adafruit.com/assets/assets/000/028/034/medium800/gps_Screenshot_from_2015-10-09_17_07_57.png?1444436120)

Click the **X** in the upper right of the **Group places by** dialog to clear it. &nbsp;You should see inside the layer there are two groups, one called **Location** with a marker for each periodic location log and another called **Good Candy** with a marker for each location the button was pressed.

To better view the good candy locations you can change the styling of the markers. &nbsp;Highlight the **Good Candy** group and click the **paint can icon** on the right side of it, this will bring up a menu to change the marker style for the good candy locations:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/035/medium800/gps_Screenshot_from_2015-10-09_17_08_32.png?1444436187)

Pick a different color and icon for the good candy locations. &nbsp;Then do the same for the other group, Location, to change how the normal location markers are displayed. &nbsp;You can adjust the marker style to anything you desire!

Change the map title by clicking&nbsp;the **Untitled map** title in the upper left. &nbsp;Give the map a good name and description.

For example here's a map with red stars for the good candy locations and green markers for the other locations:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/027/medium800/gps_Screenshot_from_2015-10-09_16_51_47.png?1444434739)

That's all there is to viewing the track your treats GPS data on Google My Maps!

The map should automatically be saved to Google Drive so you can access it again in the future. &nbsp;Use the data you learned to help improve and optimize future trick or treat runs for maximum candy acquisition!

# Track Your Treats: Halloween Candy GPS Tracker

## Adafruit IO

To view data from the FONA808 shield on Adafruit IO, first make sure you have access to the [Adafruit IO](http://io.adafruit.com/)&nbsp;beta (if you don't have access yet, a great way to get an invite is to show off a fun internet of things-related project on the [weekly show & tell show](../../../../how-to-get-added-to-the-adafruit-google-plus-show-and-tell-circle/about-show-and-tell)).

Next you'll want to familiarize yourself with Adafruit IO by checking out the guides in this [Adafruit IO series](../../../../series/adafruit-io-basics), in particular:

- [Adafruit IO Basics: Feeds](../../../../adafruit-io-basics-feeds)
- [Adafruit IO Basics: Dashboards](../../../../adafruit-io-basics-dashboards)

Then make sure you've assembled and run the FONA808 version of the sketch from the previous page. &nbsp;Once the hardware has run for a bit there should be data populated in Adafruit IO and you can build a dashboard to view it.

To build the dashboard, start by navigating to Adafruit IO at:

[http://io.adafruit.com/](http://io.adafruit.com/)

You should see a welcome dashboard like the following:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/041/medium800/gps_Screenshot_from_2015-10-12_10_24_07.png?1444671814)

Click **My Dashboards** in the upper left to go to the main Dashboard page:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/042/medium800/gps_Screenshot_from_2015-10-12_10_24_33.png?1444671884)

Now create a new dashboard by clicking **Create Dashboard** in the upper right:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/043/medium800/gps_Screenshot_from_2015-10-12_10_25_05.png?1444671924)

Give the dashboard a good name like 'Track Your Treats', then click **Create Dashboard** :

![](https://cdn-learn.adafruit.com/assets/assets/000/028/044/medium800/gps_Screenshot_from_2015-10-12_10_25_23.png?1444672792)

The new dashboard will be empty, however you can click **New Block** in the upper right to add a map block:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/045/medium800/gps_Screenshot_from_2015-10-12_10_25_44.png?1444672819)

Scroll down to the map block and click **Create** :

![](https://cdn-learn.adafruit.com/assets/assets/000/028/046/medium800/gps_Screenshot_from_2015-10-12_10_26_09.png?1444672845)

Once the feed list loads you want to find one of the feeds created by the sketch. &nbsp;By default the project uses two feeds:

- **treat-path** - This feed stores the regular location updates (every 15 seconds) so you can see the full path of trick or treating that you followed.
- **treat-good-candy** - This feed only stores locations where the button was pressed, i.e. houses that had good candy.

Let's start by creating a map block for the treat path. &nbsp;You can scroll down to find the **treat-path** feed, or type in **treat-path** to the search bar to filter to just that feed to find it:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/047/medium800/gps_Screenshot_from_2015-10-12_10_26_42.png?1444672921)

Click the **Choose** action to select the treat-path feed for this map block, then click **Next Step** to configure the block:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/048/medium800/gps_Screenshot_from_2015-10-12_10_27_11.png?1444672948)

Give the block a good title like 'Candy Path', and then put in a large value for the hours of history, like 9999. &nbsp;Right now the map block is made to display recent location data so putting in a large value like 9999 will display all the map data regardless of how old it is. &nbsp;In the future there could be new options to simplify showing all map data, but for now use a large value if you want to have the data visible on the map for a long time.

You can also change the map style from high contrast to satellite or other map views. &nbsp;High contrast looks great on the dashboard so we'll stick with it for now.

Click **Create Block** to add the new map block to the dashboard:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/049/medium800/gps_Screenshot_from_2015-10-12_10_27_34.png?1444673012)

You can resize and reconfigure the map by going into edit mode. &nbsp;Click the **Edit** button in the top left and notice the block changes slightly to show more options:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/050/medium800/gps_Screenshot_from_2015-10-12_10_28_09.png?1444673110)

You can click the trash can in the upper right corner of the block to delete it. &nbsp;Or click the gear icon next to the trash can to go back to the block configuration and change its title, hours of history, etc.

When you mouse over the block you will see a resize icon in the lower right corner of it. &nbsp;Grab the icon with the mouse and drag it out to resize the block:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/051/medium800/gps_Screenshot_from_2015-10-12_11_07_41.png?1444673278)

Once you've finished resizing and editing the block click **Done Editing** in the upper left to save the changes.

Now let's add the good candy location as another map block on the dashboard. &nbsp;Just like before click **New Block** to create a new block. &nbsp;This time select the **treat-good-candy** feed (make sure you've run the hardware and pressed the button a few times to have this feed created and populated with data):

![](https://cdn-learn.adafruit.com/assets/assets/000/028/052/medium800/gps_Screenshot_from_2015-10-12_10_37_15.png?1444673311)

Configure this good candy map with a title like 'Good Candy', and again put a large value like 9999 for hours of history. &nbsp;Then click **Create Block** to add the block to the dashboard:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/053/medium800/gps_Screenshot_from_2015-10-12_10_38_12.png?1444673341)

Resize the good candy map block just like you resized the path block. &nbsp;You can fit both maps on the dashboard to have a nice view of your full trick or treat path, and the houses that had good candy:

![](https://cdn-learn.adafruit.com/assets/assets/000/028/054/medium800/gps_Screenshot_from_2015-10-12_10_38_53.png?1444673366)

An awesome feature of Adafruit IO is that dashboards will update in real-time as data is added to the map. &nbsp;This means you and your friends & family can watch the treat path update as you walk around collecting candy. &nbsp;The periodic location updates and the good candy location button presses will pop onto the dashboard as they occur.

If you'd like to make the dashboard public so other people can view it, click the **lock icon** in the upper right to unlock the dashboard and make it public. &nbsp;Then you can copy the URL from the browser and send it to someone else to view.

Congratulations on building the track your treats candy tracker with the FONA808 shield & Adafruit IO! &nbsp;Use the data you learned to help improve and optimize future trick or treat runs for maximum candy acquisition!


## Featured Products

### Adafruit METRO 328 Fully Assembled - Arduino IDE compatible

[Adafruit METRO 328 Fully Assembled - Arduino IDE compatible](https://www.adafruit.com/product/50)
We sure love the ATmega328 here at Adafruit, and we use them&nbsp;_a lot_&nbsp;for our own projects. The processor has plenty of GPIO, Analog inputs, hardware UART SPI and I2C, timers and PWM galore - just enough for most simple projects. When we need to go small, we use a <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/50)
[Related Guides to the Product](https://learn.adafruit.com/products/50/guides)
### Adafruit Ultimate GPS Logger Shield - Includes GPS Module

[Adafruit Ultimate GPS Logger Shield - Includes GPS Module](https://www.adafruit.com/product/1272)
Brand new and better than ever, we've replaced our Adafruit GPS shield kit with this assembled shield that comes with an Ultimate GPS module. This GPS shield works great with any "Arduino shaped" board that has SPI and UART pins available,&nbsp;and is designed to log data to an...

In Stock
[Buy Now](https://www.adafruit.com/product/1272)
[Related Guides to the Product](https://learn.adafruit.com/products/1272/guides)
### Adafruit FONA 808 Shield - Mini Cellular GSM + GPS for Arduino

[Adafruit FONA 808 Shield - Mini Cellular GSM + GPS for Arduino](https://www.adafruit.com/product/2636)
Cellular + GPS tracking, all in one, for your Arduino? Oh yes! Introducing Adafruit FONA 808 GSM + GPS Shield, an all-in-one cellular phone module with that lets you add location-tracking, voice, text, SMS and data to your project, in Arduino shield format for easy use.

**Please...**

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2636)
[Related Guides to the Product](https://learn.adafruit.com/products/2636/guides)
### Passive GPS Antenna uFL - 15mm x 15mm  1 dBi gain

[Passive GPS Antenna uFL - 15mm x 15mm  1 dBi gain](https://www.adafruit.com/product/2461)
Wow that's a tiny GPS antenna! This passive antenna is only 15mm x 15mm x 6.8mm in size, with a 50mm long uFL cable. Great for when you want to keep things small.

Comes with a standard uFL connector on the end. [Perfect for our FONA...](https://www.adafruit.com/products/2542)

In Stock
[Buy Now](https://www.adafruit.com/product/2461)
[Related Guides to the Product](https://learn.adafruit.com/products/2461/guides)
### Slim Sticker-type GSM/Cellular Quad-Band Antenna - 3dBi uFL

[Slim Sticker-type GSM/Cellular Quad-Band Antenna - 3dBi uFL](https://www.adafruit.com/product/1991)
That's one slim cellular antenna! At just 75mm long from tip to tip and and with a thickness of just 2mm, this 3dBi GSM antenna is slim,&nbsp;compact and sensitive, with a 3dBi gain. &nbsp;The antenna juts&nbsp;out from its base with stick-on back so you attach it to an enclosure if...

In Stock
[Buy Now](https://www.adafruit.com/product/1991)
[Related Guides to the Product](https://learn.adafruit.com/products/1991/guides)
### Lithium Ion Polymer Battery - 3.7v 1200mAh

[Lithium Ion Polymer Battery - 3.7v 1200mAh](https://www.adafruit.com/product/258)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 1200mAh for a total of about 4.5 Wh. If you need a larger battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/258)
[Related Guides to the Product](https://learn.adafruit.com/products/258/guides)
### Shield stacking headers for Arduino (R3 Compatible)

[Shield stacking headers for Arduino (R3 Compatible)](https://www.adafruit.com/product/85)
_“How could something so simple be so useful?”&nbsp;_

We heard once that&nbsp;in the 4th millennium B.C.&nbsp;some guy asked the person who invented the wheel that question.&nbsp; The person who invented the wheel’s answer, we were told, was...

Out of Stock
[Buy Now](https://www.adafruit.com/product/85)
[Related Guides to the Product](https://learn.adafruit.com/products/85/guides)
### 9V battery holder with switch &  5.5mm/2.1mm plug

[9V battery holder with switch &  5.5mm/2.1mm plug](https://www.adafruit.com/product/67)
This is a 9V battery pack with on/off switch and a pre-attached 5.5mm/2.1mm center-positive barrel plug. Use this to battery-power your Arduino (or other electronic projects) - it's ready to go out of the box!

Battery & screw not included.

![]()

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

## Related Guides

- [Ladyada's Toolkit](https://learn.adafruit.com/ladyadas-toolkit.md)
- [Mini Thermal Receipt Printers](https://learn.adafruit.com/mini-thermal-receipt-printer.md)
- [Wave Shield](https://learn.adafruit.com/adafruit-wave-shield-audio-shield-for-arduino.md)
- [Bluetooth Temperature & Humidity Sensor](https://learn.adafruit.com/bluetooth-temperature-and-humidity-sensor.md)
- [Trinket Audio Player](https://learn.adafruit.com/trinket-audio-player.md)
- [Digital Circuits 7: MCUs... how do they work?](https://learn.adafruit.com/mcus-how-do-they-work.md)
- [Arduino Lesson 3. RGB LEDs](https://learn.adafruit.com/adafruit-arduino-lesson-3-rgb-leds.md)
- [Arduino Lesson 11. LCD Displays - Part 1](https://learn.adafruit.com/adafruit-arduino-lesson-11-lcd-displays-1.md)
- [Low Power Coin Cell Voltage Logger](https://learn.adafruit.com/low-power-coin-cell-voltage-logger.md)
- [Arduino Lesson 15. DC Motor Reversing](https://learn.adafruit.com/adafruit-arduino-lesson-15-dc-motor-reversing.md)
- [Arduino GPS Clock](https://learn.adafruit.com/arduino-clock.md)
- [Circuit Playground: D is for Diode](https://learn.adafruit.com/circuit-playground-d-is-for-diode.md)
- [Low Power WiFi Datalogger](https://learn.adafruit.com/low-power-wifi-datalogging.md)
- [SMS Texting Pet Food Dish](https://learn.adafruit.com/sms-texting-pet-food-dish.md)
- [All About Arduino Libraries](https://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use.md)
- [Compost Friend!](https://learn.adafruit.com/compost-optimization-machine.md)
