# How Tall Is It?

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/036/654/medium800/circuit_playground_diagram.png?1476724338)

This is a fun and simple beginner project that turns the Circuit Playground into an inclinometer. An inclinometer is a device that can determine the angle of something relative to the horizontal. With this information and some right angle math, the height of tall objects can be determined. Don't worry, all the math is provided and use of a calculator is allowed.

Info: 

# Required Parts

This project uses the sensors already included on the Circuit Playground, either a [Classic](https://www.adafruit.com/products/3000) or an [Express](https://www.adafruit.com/products/3333). The only additional items needed are batteries for power and a holder for the batteries.

- Circuit Playground

  - [Classic](https://www.adafruit.com/products/3000)
  - [Express](https://www.adafruit.com/products/3333)

- [3 x AAA Battery Holder](https://www.adafruit.com/products/727)
- 3 x AAA Batteries (NiMH work great!)

![circuit_playground_items.jpg](https://cdn-learn.adafruit.com/assets/assets/000/036/645/medium640/circuit_playground_items.jpg?1476714943)

# Other Items

To build the inclinometer, you will need a few other items. A plastic tube is used to create a sight. This could be a drinking straw, the barrel of an old writing pen, or anything similar. Some rubber bands are used to hold the sight to the battery pack. Double backed tape provides a secure way of mounting the Circuit Playground to the battery pack.

- Plastic straw or other tube
- Rubber bands
- Double backed tape

![circuit_playground_parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/036/655/medium640/circuit_playground_parts.jpg?1476725003)

# Before Starting

If you are new to the Circuit Playground, you may want to first read these overview guides.

## Circuit Playground Classic

- [Overview](../../../introducing-circuit-playground)
- [Lesson #0](../../../circuit-playground-lesson-number-0)

## Circuit Playground Express

- [Overview](../../../adafruit-circuit-playground-express/)

# How Tall Is It?

## Hello Accelerometer

## Using Arduino Serial Monitor

Since this project uses the accelerometer, let's start by exploring how it works and behaves. You can read some technical details in the [Lesson #0 Guide](../../../../circuit-playground-lesson-number-0/accelerometer). And for reference, here is where the accelerometer is located on the Circuit Playground.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/609/medium800/circuit_playground_accel.jpg?1476483106)

There is an example sketch included with the Circuit Playground library that we can use to play around with the accelerometer. It can be found in the following location:  
  
**File -\> Examples -\> Adafruit Circuit Playground -\> Hello\_CircuitPlayground -\> Hello\_Accelerometer**  
  
With this sketch loaded and running on the Circuit Playground, open the Serial Monitor.  
  
**Tools -\> Serial Monitor**  
  
The current values from the accelerometer will be printed once a second.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/539/medium800/circuit_playground_accelerometer_serialmon.png?1476400806)

Try rotating the Circuit Playground around in various orientations and watch how the values change. The values are in units of m/s<sup>2</sup> (meters per second squared). If you are doing this on planet Earth, you will see a value of 9.8 m/s<sup>2</sup> showing up when an axis is aligned vertically. This value will be there even if the Circuit Playground is held still and does not move. More on this later.

Another way to watch the values of the accelerometer is to use the Serial Plotter. To do this, let's first modify the code slightly. The code below changes the format of the output to work with the Serial Plotter and increases the rate at which the values are displayed.

```auto
#include &lt;Adafruit_CircuitPlayground.h&gt;
#include &lt;Wire.h&gt;
#include &lt;SPI.h&gt;
  
float X, Y, Z;

void setup() {
  Serial.begin(9600);
  CircuitPlayground.begin();
}

void loop() {
  X = CircuitPlayground.motionX();
  Y = CircuitPlayground.motionY();
  Z = CircuitPlayground.motionZ();

  Serial.print(X);
  Serial.print(",");
  Serial.print(Y);
  Serial.print(",");
  Serial.println(Z);

  delay(100);
}
```

With this sketch loaded and running on the Circuit Playground, open the Serial Plotter.

**Tools -\> Serial Plotter**

The accelerometer values will now be plotted like a strip chart as shown below. There should be 3 lines, one each for the X, Y, and Z values. Again, play around with rotating the Circuit Playground and watch the values change.

In the example below, the Circuit Playground was slowly rotated so that each axis aligned with the vertical, held there for a bit, and then rotated again. Finally, it was given a bit of a shake.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/540/medium800/circuit_playground_accelerometer_time_history1.png?1476400824)

## Using CircuitPython REPL

If you want to do the same thing using CircuitPython, here is a simple program to do that:

Info: 

```auto
# Circuit Playground Express Accelerometer
import time
from adafruit_circuitplayground.express import cpx

# Loop forever
while True:
    x,y,z = cpx.acceleration
    print("X={:6.2f}\tY={:6.2f}\tZ={:6.2f}".format(x,y,z))
    time.sleep(1)
```

Save the above to a file named **main.py** on your Circuit Playground Express. Then read the following guide section for how to setup and access the REPL:

[Serial Console (REPL)](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)
With the above program running on the Circuit Playground Express, you should see output like this in your REPL:

![](https://cdn-learn.adafruit.com/assets/assets/000/048/910/medium800/classic_repl_accelo.jpg?1512428674)

Try shaking and rotating your Circuit Playground Express around to watch how the values change.

# How Tall Is It?

## Gravity and Acceleration

As the name implies, an accelerometer measures acceleration. Acceleration happens when the velocity of something changes, like a Circuit Playground at rest which is suddenly moved. A Circuit Playground sitting still on your desk is obviously not accelerating. So why does the accelerometer still read 9.8 m/s<sup>2</sup>? The answer is gravity.

Gravity is what makes apples fall from trees and holds us to the Earth. If you looked at the planet from far away, you could think of gravity looking something like the figure below. All the arrows point in towards the planet. That's how you can stand at the South Pole and not fall off.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/597/medium800/circuit_playground_earth_gravity.png?1476469038)

If we zoomed way in to just the local area where you might be, say standing outside with a Circuit Playground, it would look more like the figure below. The Earth is so big that close up it looks flat. Now all the lines are straight and point down.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/598/medium800/circuit_playground_local_gravity.png?1476469054)

Just like gravity happens in a direction (down), acceleration also happens in a direction. In order to determine the direction, the Circuit Playground uses an XYZ coordinate system. For reference, there's a little diagram printed on the silk screen next to the accelerometer chip. A larger version is shown in the figure below. Z points out.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/599/medium800/circuit_playground_cp_coord_sys.png?1476469074)

So let's say you held the Circuit Playground at a little tilt angle as shown by the coordinate system below. Gravity, as shown by the blue arrow, will still point down. In this case, the accelerometer will sense some of it in the X direction and some of it in the Y direction. However, from the point of view of the Circuit Playground, it feels like it's accelerating in the direction of the green arrow. You can test this yourself by placing the Circuit Playground flat on your desk. The Z axis will be pointing up and gravity will be pointing down. However, the value returned from `motionZ()`is positive. The Circuit Playground feels like it's accelerating up off your desk!

![](https://cdn-learn.adafruit.com/assets/assets/000/036/600/medium800/circuit_playground_rotated_with_gravity.png?1476469090)

OK, now for the math. Sorry, but this is important. It's how we can use the accelerometer to measure angles and turn the Circuit Playground into an inclinometer. Also, rockets are built using math like this.

The same tilted axis and green arrow from above are shown again below. The red arrow represent the amount that the X axis will sense and returned by `motionX()`. Similarly, the blue arrow represents the amount the Y axis will sense and returned by `motionY()`. All together they form a special kind of triangle called a "right triangle", where one of the angles is a "right angle", which means it equals 90 degrees.

The tilt angle is shown in two places. The one on the left is what we are really interested in. However, it turns out it is the same as the one on the right, inside our right triangle. That's cool, since it let's us use `motionX()` and `motionY()` to compute the tilt angle.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/601/medium800/circuit_playground_rotated_with_components.png?1476469115)

Now let's focus on that right triangle. It is shown below with the other stuff removed and rotated to make it easier to look at. Also, the equation needed to compute the tilt angle is shown.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/602/medium800/circuit_playground_right_angle_math.png?1476469163)

The function **atan** is called the arctangent, or inverse tangent.&nbsp;It does the opposite of what the tangent function does. They are both part of a whole discipline of math called trigonometry. We will use the tangent function later when we go outside to measure the height of things. However, we will let either the Circuit Playground or a calculator do the math for us.

# How Tall Is It?

## Measuring Height

OK, a little more math. But don't worry, this is pretty much the same thing as the previous page, just with different values. There's our friend the right triangle shown again in the figure below. This time, we want to compute the **HEIGHT**. To do so, we use the tangent function and do a little rearranging. The resulting equation is shown below.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/656/medium800/circuit_playground_distance_height_math.png?1476725784)

So all we need to know is the **DISTANCE** and the **ANGLE** and we can compute the **HEIGHT**. The figure below shows how this would work for measuring the height of a tree.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/607/medium800/circuit_playground_diagram.png?1476482410)

We will use the Circuit Playground to give us the **ANGLE** value. We will then use a calculator to compute the tangent of that angle. There are various ways to come up with the **DISTANCE** to the object, which you will see later in some example use cases.

Download and print the following worksheet to help guide you through the process. It also has the decoder ring for reading the angle value off the Circuit Playground.

[How_Tall_Is_It_Worksheet.pdf](https://cdn-learn.adafruit.com/assets/assets/000/036/608/original/How_Tall_Is_It_Worksheet.pdf?1476482829)
Great! Now let's turn the Circuit Playground into an inclinometer.

# How Tall Is It?

## Assembling the Inclinometer

To assemble the inclinometer, channel your inner MacGyver, and follow the steps below.

Draw a reference line 3/4" below the top of the battery pack. This will be used to help align the Circuit Playground when we mount it.

![circuit_playground_assy_step_1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/036/633/medium640/circuit_playground_assy_step_1.jpg?1476667575)

Cut off a piece of double backed tape. About 1" x 1" is good.

![circuit_playground_assy_step_2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/036/634/medium640/circuit_playground_assy_step_2.jpg?1476667634)

Apply the double backed tape to the battery pack.

![circuit_playground_assy_step_3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/036/635/medium640/circuit_playground_assy_step_3.jpg?1476667707)

When placing the Circuit Playground on the tape, try to keep the line centered in the 3.3V hole on the left and the GND hole on the right.

![circuit_playground_assy_step_4_align.jpg](https://cdn-learn.adafruit.com/assets/assets/000/036/640/medium640/circuit_playground_assy_step_4_align.jpg?1476672073)

Apply the Circuit Playground to the double backed tape and press down firmly.

![circuit_playground_assy_step_4.jpg](https://cdn-learn.adafruit.com/assets/assets/000/036/636/medium640/circuit_playground_assy_step_4.jpg?1476667765)

Attach the plastic straw to the top of the battery case using the rubber bands.

![circuit_playground_assy_step_5.jpg](https://cdn-learn.adafruit.com/assets/assets/000/036/641/medium640/circuit_playground_assy_step_5.jpg?1476672175)

And here's the fully assembled inclinometer. Didn't use a paper clip, but still pretty MacGyvery.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/646/medium800/circuit_playground_assy_final.jpg?1476719994)

Now let's load the inclinometer software.

# How Tall Is It?

## Inclinometer Software

The code is available in Arduino and [CircuitPython](../../../../adafruit-circuit-playground-express/adafruit2-circuitpython).

# How Tall Is It?

## Arduino

Here is the code to turn the Circuit Playground into an inclinometer. Copy and paste it into the Arduino IDE, load it on to the Circuit Playground, and go the next page to learn how to use it.

Info: 

```auto
///////////////////////////////////////////////////////////////////////////////
// Circuit Playground How Tall Is It
// 
// Uses the accelerometer to turn the Circuit Playground into an inclinometer.
// Can be used to determine the height of objects using a little right angle
// math.
//
// Author: Carter Nelson
// MIT License (https://opensource.org/licenses/MIT)

#include &lt;Adafruit_CircuitPlayground.h&gt;
#include &lt;Wire.h&gt;
#include &lt;SPI.h&gt;

float X, Y, Z;
float angle;
float totalAccel;
bool goodReading;
uint8_t angleDisplay;

///////////////////////////////////////////////////////////////////////////////
void setup()
{
  // Initialize Circuit Playground library.
  CircuitPlayground.begin();

  // Set the accelerometer range.
  CircuitPlayground.setAccelRange(LIS3DH_RANGE_2_G);

  // Indicate ready using NeoPixel 9.
  // Set it red to indicate no good reading yet.
  CircuitPlayground.setPixelColor(9, 255, 0, 0);
}

///////////////////////////////////////////////////////////////////////////////
void loop()
{
  // Only take action when either button is pressed.
  if ( (CircuitPlayground.leftButton()  == true) || 
       (CircuitPlayground.rightButton() == true) ) {
    
    // Average several readings.
    X = 0.0;
    Y = 0.0;
    Z = 0.0;
    for (int i=0; i&lt;10; i=i+1) {
      X = X + CircuitPlayground.motionX();
      Y = Y + CircuitPlayground.motionY();
      Z = Z + CircuitPlayground.motionZ();
      delay(10);
    }
    X = X / 10.0;
    Y = Y / 10.0;
    Z = Z / 10.0;
    
    // Compute angle.
    if (CircuitPlayground.isExpress()) {
      angle = atan2(-X, Y);
    } else {
      angle = atan2(Y, X);
    }

    // Compute total acceleration
    totalAccel = sqrt(X*X + Y*Y + Z*Z);

    // Initially assume the reading is good.
    goodReading = true;

    // Check for levelness.
    // Ideally Z=0, but allow a small amount of Z.
    if (abs(Z) &gt; 1.0) {
      goodReading = false;
    }

    // Check for motion.
    // Gravity (9.8 m/s^2) should be the only acceleration, but allow a small amount of motion.
    if (totalAccel &gt; 10.0) {
      goodReading = false;
    } 
    
    // Indicate if reading was good.
    if (goodReading == true) {
      // Green light.
      CircuitPlayground.setPixelColor(9, 0, 255, 0);
    } else {
      // Red light.
      CircuitPlayground.setPixelColor(9, 255, 0, 0);
    }
    
    // Indicate sign of angle.
    if (angle &lt; 0) {
      // Blue light.
      CircuitPlayground.setPixelColor(8, 0, 0, 255);
    } else {
      // Off.
      CircuitPlayground.setPixelColor(8, 0, 0, 0);
    }
    
    // Display angle magnitude, in degrees, on NeoPixels 0-7 as 8 bit value.
    // 1 = NeoPixel ON, 0 = NeoPixel OFF
    // First, convert the angle to degrees and make integer. 
    angleDisplay = uint8_t(abs(angle * 57.29578));
    // Now display one bit at a time
    for (int p=0; p&lt;8; p=p+1) {
      // Is the least signficant bit a 1?
      if (angleDisplay &amp; 0x01 == 1) {
        // Turn on the NeoPixel
        CircuitPlayground.setPixelColor(p, 255, 255, 255);
      } else {
        // Turn off the NeoPixel
        CircuitPlayground.setPixelColor(p, 0, 0, 0);
      }
      // Shift the value down to the next bit.
      angleDisplay = angleDisplay &gt;&gt; 1;
    }
    
  }
}
```

# How Tall Is It?

## CircuitPython

Here is the CircuitPython code to turn the Circuit Playground into an inclinometer. Save it to a file named **main.py** and place it on your Circuit Playground.

Info: 

```auto
# Circuit Playground Express How Tall Is It
# 
# Uses the accelerometer to turn the Circuit Playground into an inclinometer.
# Can be used to determine the height of objects using a little right angle
# math.
#
# Author: Carter Nelson
# MIT License (https://opensource.org/licenses/MIT)
import time
import math
from adafruit_circuitplayground.express import cpx

# Indicate ready using NeoPixel 9.
# Set it red to indicate no good reading yet.
cpx.pixels[9] = ((255, 0, 0))

while True:
    if (cpx.button_a or cpx.button_b):
        # Compute average
        X = 0
        Y = 0
        Z = 0
        for count in range(10):
            x,y,z = cpx.acceleration
            X = X + x
            Y = Y + y
            Z = Z + z
            time.sleep(0.01)
        X = X / 10
        Y = Y / 10
        Z = Z / 10
        
        # Compute angle
        angle = math.atan2(-X, Y)
        
        # Compute total acceleration
        total_accel = math.sqrt(X*X + Y*Y + Z*Z)
        
        # Initially assume the reading is good
        good_reading = True
        
        # Check for levelness
        # Ideally Z=0, but allow a small amount of Z
        if abs(Z) &gt; 1.0:
            good_reading = False
            
        # Check for motion
        # Gravity (9.8 m/s^2) should be the only acceleration, but allow a small amount of motion.
        if total_accel &gt; 10:
            good_reading = False
            
        # Indicate if reading was good
        if good_reading:
            # Green light
            cpx.pixels[9] = (0, 255, 0)
        else:
            # Red light
            cpx.pixels[9] = (255, 0, 0)
        
        # Indicate sign of angle
        if angle &lt; 0:
            # Blue light
            cpx.pixels[8] = (0, 0, 255)
        else:
            # Off
            cpx.pixels[8] = (0, 0, 0)
            
        # Display angle magnitude, in degrees, on NeoPixels 0-7 as 8 bit value.
        # 1 = NeoPixel ON, 0 = NeoPixel OFF
        angle_display = int(abs(angle * 57.29578))
        for p in range(8):
            if angle_display &amp; 0x01 == 1:
                # Turn on the NeoPixel
                cpx.pixels[p] = (255, 255, 255)
            else :
                # Turn off the NeoPixel
                cpx.pixels[p] = (0, 0, 0)
            angle_display = angle_display &gt;&gt; 1
```

# How Tall Is It?

## Using the Inclinometer

With the inclinometer sketch loaded and running on the Circuit Playground, you can now use it to make angle measurements. The general steps are:

1. Sight in the top of the object through the plastic tube.
2. Hold the Circuit Playground upright and still, then press either button to take a reading.
3. The results will be shown on the NeoPixels #0-#8.
4. If the #9 NeoPixel is red, try again. The Circuit Playground was either not upright or there was too much motion.

# Hold It Upright

In order for the angle measurement to be accurate, gravity should be sensed only in the X and Y directions. This is done by holding the Circuit Playground upright as shown in the figure below. Don't let it tilt too much to the left or right.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/690/medium800/circuit_playground_tilt.jpg?1476757919)

# Reading the Angle

If there were some kind of text display on the Circuit Playground, we could use that to display the angle directly. However, there isn't one, so we need to do something else. The approach taken here is to use the first 8 NeoPixels, #0-#7, to indicate the magnitude of the angle. The sign (+ or -) is indicated on the #8 NeoPixel.

The [worksheet](https://cdn-learn.adafruit.com/assets/assets/000/036/608/original/How_Tall_Is_It_Worksheet.pdf) includes the following diagram to help determine the angle from the sequence of lit NeoPixels.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/691/medium800/circuit_playground_decoder.jpg?1476758082)

To figure out the angle, simply add up each number shown for each NeoPixel that is lit. If the NeoPixel is not lit, do not add in that number.

For example, if these NeoPixels were lit (remember numbering starts with #0):

**#1, #3, and #5**

We would add up the corresponding numbers:

**2 + 8 + 32 = 42**

To come up with the value **42**. If the #8 NeoPixel had been lit blue, then the value would have been **-42**.

# How Tall Is It?

## Example - Space Needle

How tall is the Space Needle? Sure, The Google could tell you in an instant, but let's see what the Circuit Playground says.

First thing is to find a safe location with a good view. This street corner works.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/647/medium800/circuit_playground_space_needle_1.jpg?1476722370)

Next we need to know the distance from here to the Space Needle. For this we will ask The Google for help. You can use Google Maps to measure the distance between two locations. Here are the steps used to determine the distance from the Space Needle to the street corner. This can be done for other locations as well.

Move mouse pointer to the location of the object (in this case, the Space Needle) and right click to bring up menu. Select **Measure distance**.

![circuit_playground_dist_maps_1.png](https://cdn-learn.adafruit.com/assets/assets/000/036/648/medium640/circuit_playground_dist_maps_1.png?1476722445)

A small round circle will be placed to indicate the starting location. This can be relocated by grabbing and moving it with the mouse.

![circuit_playground_dist_maps_2.png](https://cdn-learn.adafruit.com/assets/assets/000/036/649/medium640/circuit_playground_dist_maps_2.png?1476722532)

Click on the location where you are taking the angle measurement. A line will be drawn between the two points and the distance will be shown. Rounding to the nearest foot is fine, so in this case **780 ft**.

![circuit_playground_dist_maps_3.png](https://cdn-learn.adafruit.com/assets/assets/000/036/650/medium640/circuit_playground_dist_maps_3.png?1476722632)

Now we use our Circuit Playground inclinometer to measure the angle to the top of the Space Needle. Sight in the top through the plastic tube and press either button to take a measurement.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/651/medium800/circuit_playground_space_needle_2.jpg?1476722827)

Here is the resulting display on the Circuit Playground. The green light on NeoPixel #9 means the reading is good, the #0, #2, and #5 NeoPixels are lit indicating the angle, and since the #8 NeoPixel is not lit, the value is positive.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/684/medium800/circuit_playground_space_needle_3.jpg?1476752372)

Now we can use the [worksheet](https://cdn-learn.adafruit.com/assets/assets/000/036/608/original/How_Tall_Is_It_Worksheet.pdf) to determine what angle is being indicated. In this case:

**1 + 4 + 32 = 37 degrees**

Then use a calculator to get the tangent of this angle:

**tan (37 deg) = 0.7536**

We determined our distance was 780 feet above, so just need to multiply to get the final answer:

**780 x 0.7536 = 587.808**

Let's just call it **588 feet**.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/685/medium800/circuit_playground_space_needle_4.jpg?1476752774)

The actual height of the Space Needle is **605 feet**. So our reading was off by **17 feet**. Oh well, not perfect, but not bad for a plastic straw and some rubber bands.

# How Tall Is It?

## Example - A Tree

How tall is that tree? This time the Internet can't help us.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/652/medium800/circuit_playground_tree_1.jpg?1476723312)

In order to determine the distance to the tree, a very simple method was used: paces. Paces are just slow deliberate steps that are as close to the same as possible each time. The actual size of a pace will be different for different sized people. For this case, the distance was **44 paces**.

Then, to get the angle, use the Circuit Playground and sight in the top of the tree. Press either button to get a reading.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/653/medium800/circuit_playground_tree_2.jpg?1476723400)

Here is the resulting display on the Circuit Playground. The green light on NeoPixel #9 means the reading is good, the #0, #3, and #4 NeoPixels are lit indicating the angle, and since the #8 NeoPixel is not lit, the value is positive.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/686/medium800/circuit_playground_tree_3.jpg?1476753445)

Now we can use the [worksheet](https://cdn-learn.adafruit.com/assets/assets/000/036/608/original/How_Tall_Is_It_Worksheet.pdf) to determine what angle is being indicated. In this case:

**1 + 8 + 16 = 25 degrees**

Then use a calculator to get the tangent of this angle:

**tan (25 deg) = 0.4663**

We determined our distance was 44 paces above, so just need to multiply to get the final answer:

**44 x 0.4663 = 20.5**

Let's just call it **21 paces**.

![](https://cdn-learn.adafruit.com/assets/assets/000/036/687/medium800/circuit_playground_tree_4.jpg?1476753579)

Great. But how tall is that? If you take this approach you will need to determine how big your paces are. You can place a tape measure on the ground and step next to it to get an idea. I came up with about 3 feet for my pace, which gives:

**3 feet/pace x 21 paces = 63 feet**

The tree is about **63 feet** tall.

# How Tall Is It?

## Questions and Code Challenges

The following are some questions related to this project along with some suggested code challenges. The idea is to provoke thought, test your understanding, and get you coding!

While the inclinometer sketch provided works, there is room for improvement and additional features. Have fun playing with the provided code to see what you can do with it.

# Questions

- Why is it important for the Circuit Playground to be upright and held still?
- Are there any issues with making the angle reading at eye level?
- Would this work on the moon?
- Would this work in space, for example, on the International Space Station?

# Code Challenges

- Add an audio cue to indicate if the measurement is good or bad.
- Improve the resolution of the indicated angle measurement.
- Incorporate all the math into the Circuit Playground so it provides height directly.


## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

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

[Circuit Playground Classic](https://www.adafruit.com/product/3000)
Would you like to learn electronics, with an all-in-one board that has sensors and LEDs built in? **Circuit Playground** is here - and it's the best way to practice programming on real hardware with no soldering or sewing required!

This is the **Classic**...

In Stock
[Buy Now](https://www.adafruit.com/product/3000)
[Related Guides to the Product](https://learn.adafruit.com/products/3000/guides)
### 3 x AAA Battery Holder with On/Off Switch and 2-Pin JST

[3 x AAA Battery Holder with On/Off Switch and 2-Pin JST](https://www.adafruit.com/product/727)
This battery holder connects 3 AAA batteries together in series for powering all kinds of projects. We spec'd these out because the box is slim, and 3 AAA's add up to about 3.3-4.5V, a very similar range to Lithium Ion/polymer (Li-Ion) batteries and have an on-off switch. That makes...

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

## Related Guides

- [Introducing Circuit Playground](https://learn.adafruit.com/introducing-circuit-playground.md)
- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Circuit Playground Lesson #0](https://learn.adafruit.com/circuit-playground-lesson-number-0.md)
- [Snap Fit Mount for Circuit Playground Express](https://learn.adafruit.com/snap-fit-mount-for-circuit-playground-express.md)
- [Perfect Pitch Machine](https://learn.adafruit.com/perfect-pitch-machine.md)
- [Cyberpunk Santa Eye](https://learn.adafruit.com/cyberpunk-santa-eye.md)
- [CircuitPython with Jupyter Notebooks](https://learn.adafruit.com/circuitpython-with-jupyter-notebooks.md)
- [Musical Walking Stick with Circuit Playground](https://learn.adafruit.com/musical-cane-walking-stick.md)
- [LED Reactive Light-Up Hockey Puck in MakeCode](https://learn.adafruit.com/led-hockey-puck.md)
- [DAC Hacks for Circuit Playground Express & other ATSAMD21 Boards](https://learn.adafruit.com/circuit-playground-express-dac-hacks.md)
- [CircuitPython Hardware: ILI9341 TFT & FeatherWing](https://learn.adafruit.com/micropython-hardware-ili9341-tft-and-featherwing.md)
- [NeoPixels with MakeCode](https://learn.adafruit.com/neopixels-with-makecode.md)
- [Fidget Spinner Tachometer](https://learn.adafruit.com/fidget-spinner-tachometer.md)
- [Circuit Playground Express TV Zapper](https://learn.adafruit.com/circuitpython-tv-zapper-with-circuit-playground-express.md)
- [Makecode para la Circuit Playground Express](https://learn.adafruit.com/makecode-es.md)
- [Circuit Playground Wearable](https://learn.adafruit.com/circuit-playground-wearable.md)
- [Program CircuitPython USB Devices with iPhone & iPad](https://learn.adafruit.com/use-circuitpython-devices-with-iphone-ipad.md)
