You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: examples/Euler/Euler.ino
+14-14
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@
21
21
* notice, this list of conditions and the following disclaimer in the
22
22
* documentation and/or other materials provided with the distribution.
23
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
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
26
* this software without specific prior written permission.
27
27
*
28
28
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -35,39 +35,39 @@
35
35
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36
36
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37
37
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
38
-
*
38
+
*
39
39
* The information provided is believed to be accurate and reliable.
40
40
* The copyright holder assumes no responsibility for the consequences of use
41
41
* of such information nor for any infringement of patents or
42
42
* other rights of third parties which may result from its use.
43
43
* No license is granted by implication or otherwise under any patent or
44
-
* patent rights of the copyright holder.
44
+
* patent rights of the copyright holder.
45
45
*/
46
46
47
-
#include"NAxisMotion.h"//Contains the bridge code between the API and the Arduino Environment
47
+
#include"NineAxesMotion.h"//Contains the bridge code between the API and the Arduino Environment
48
48
#include<Wire.h>
49
49
50
-
NAxisMotion mySensor; //Object that for the sensor
50
+
NineAxesMotion mySensor; //Object that for the sensor
51
51
unsignedlong lastStreamTime = 0; //To store the last streamed time stamp
52
52
constint streamPeriod = 20; //To stream at 50Hz without using additional timers (time period(ms) =1000/frequency(Hz))
53
53
54
54
voidsetup() //This code is executed once
55
-
{
55
+
{
56
56
//Peripheral Initialization
57
57
Serial.begin(115200); //Initialize the Serial Port to view information on the Serial Monitor
58
58
I2C.begin(); //Initialize I2C communication to the let the library communicate with the sensor.
59
59
//Sensor Initialization
60
60
mySensor.initSensor(); //The I2C Address can be changed here inside this function in the library
61
61
mySensor.setOperationMode(OPERATION_MODE_NDOF); //Can be configured to other operation modes as desired
62
62
mySensor.setUpdateMode(MANUAL); //The default is AUTO. Changing to MANUAL requires calling the relevant update functions prior to calling the read functions
63
-
//Setting to MANUAL requires fewer reads to the sensor
63
+
//Setting to MANUAL requires fewer reads to the sensor
64
64
}
65
65
66
66
voidloop() //This code is looped forever
67
67
{
68
68
if ((millis() - lastStreamTime) >= streamPeriod)
69
69
{
70
-
lastStreamTime = millis();
70
+
lastStreamTime = millis();
71
71
mySensor.updateEuler(); //Update the Euler data into the structure of the object
72
72
mySensor.updateCalibStatus(); //Update the Calibration Status
0 commit comments