You are on page 1of 1

Figure 4-5.

Graph of your foos as measured in bars

Read Data from a Sensor


Now let’s experiment with talking to a sensor using ANT+ technol‐
ogy, the Garmin tempe temperature sensor. This project won’t be an
activity recorder; it will display the values, but won’t record them.

1. Choose File→New→Connect IQ Project. Name it TempeApp,


make it a Watch App, and choose Square Watch as the target
platform (along with any other platforms you want to use).
2. Delete the following files or directories from the project (right-
click, then choose Delete): resources/menus, resources/layouts,
and source/TempeAppMenuDelegate.mc. These files relate to
portions of the sample app (specifically, the part that displays
the sample menus) that you won’t need for this project.
3. Open source/TempeAppDelegate.mc in the editor, and remove
the entire onMenu() function. The file should look like this
when you’re done:
using Toybox.WatchUi as Ui;

class TempeAppDelegate extends Ui.BehaviorDelegate {

function initialize() {

42 | Chapter 4: Projects

You might also like