1 | /****************************************************************************
|
---|
2 | * Copyright (C) 2011 - 2014 Bosch Sensortec GmbH
|
---|
3 | *
|
---|
4 | * BareMinimum.ino
|
---|
5 | * Date: 2014/08/25
|
---|
6 | * Revision: 2.1 $
|
---|
7 | *
|
---|
8 | * Usage: Example code to describe the Bare Minimum
|
---|
9 | *
|
---|
10 | ****************************************************************************
|
---|
11 | /***************************************************************************
|
---|
12 | * License:
|
---|
13 | *
|
---|
14 | * Redistribution and use in source and binary forms, with or without
|
---|
15 | * modification, are permitted provided that the following conditions are met:
|
---|
16 | *
|
---|
17 | * Redistributions of source code must retain the above copyright
|
---|
18 | * notice, this list of conditions and the following disclaimer.
|
---|
19 | *
|
---|
20 | * Redistributions in binary form must reproduce the above copyright
|
---|
21 | * notice, this list of conditions and the following disclaimer in the
|
---|
22 | * documentation and/or other materials provided with the distribution.
|
---|
23 | *
|
---|
24 | * Neither the name of the copyright holder nor the names of the
|
---|
25 | * contributors may be used to endorse or promote products derived from
|
---|
26 | * this software without specific prior written permission.
|
---|
27 | *
|
---|
28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
---|
29 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
---|
30 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
31 | * DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
---|
32 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
---|
33 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
---|
34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
35 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
36 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
---|
37 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
---|
38 | *
|
---|
39 | * The information provided is believed to be accurate and reliable.
|
---|
40 | * The copyright holder assumes no responsibility for the consequences of use
|
---|
41 | * of such information nor for any infringement of patents or
|
---|
42 | * other rights of third parties which may result from its use.
|
---|
43 | * No license is granted by implication or otherwise under any patent or
|
---|
44 | * patent rights of the copyright holder.
|
---|
45 | */
|
---|
46 |
|
---|
47 | #include "NAxisMotion.h" //Contains the bridge code between the API and the Arduino Environment
|
---|
48 | #include <Wire.h>
|
---|
49 |
|
---|
50 | NAxisMotion mySensor; //Object that for the sensor
|
---|
51 |
|
---|
52 | void setup() //This code is executed once
|
---|
53 | {
|
---|
54 | //Peripheral Initialization
|
---|
55 | I2C.begin(); //Initialize I2C communication to the let the library communicate with the sensor.
|
---|
56 | //Sensor Initialization
|
---|
57 | mySensor.initSensor(); //The I2C Address can be changed here inside this function in the library
|
---|
58 | mySensor.setOperationMode(OPERATION_MODE_NDOF); //Can be configured to other operation modes as desired
|
---|
59 | }
|
---|
60 |
|
---|
61 | void loop() //This code is looped forever
|
---|
62 | {
|
---|
63 | //Blank
|
---|
64 | }
|
---|