Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Bubble Level Demo

This demo application utilizes the on-board accelerometer to implement a bubble level.

Overview

The bubble level application demonstrates basic usage of the on-board accelerometer to implement a bubble level. A bubble level utilizes two axes to visually show deviation from a level plane (0 degrees) on a given access. This demo uses the FTM to modulate the duty cycle of two onboard LEDs to gradually increase LED intensity as the board deviates from a level state.

Optionally, if you would like to observe the raw accelerometer X-Y data, you can connect to the board's virtual COM port.

This application is loaded onto the board at the factory for supported hardware platforms.

Supported Platforms

System Requirement

Hardware requirements

Toolchain requirements

Software requirements

Getting Started

Hardware Settings

The bubble level application does not call for any special hardware configuration. Although not required, the recommendation is to leave the development board jumper settings and configurations in default state when running this demo.

Prepare the Demo

  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.
  2. (Optional) Open a serial terminal with these settings:
    • 115200 baud rate
    • 8 data bits
    • No parity
    • One stop bit
    • No flow control
  3. Download the program to the target board.
  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

For detailed instructions, see the Getting Started with Kinetis SDK document.

Run the demo

When the board is programmed, simply tilt the board to see the RGB LED illuminate. One LED color indicates X-axis variation while another indicates Y-axis variation.