Skip to content

Commit 04d2d37

Browse files
committedNov 21, 2016
change name to NineAxesMotion
1 parent f71feaa commit 04d2d37

File tree

7 files changed

+109
-108
lines changed

7 files changed

+109
-108
lines changed
 

‎examples/Accelerometer/Accelerometer.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
* patent rights of the copyright holder.
4545
*/
4646

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
4848
#include <Wire.h>
4949

50-
NAxisMotion mySensor; //Object that for the sensor
50+
NineAxesMotion mySensor; //Object that for the sensor
5151
unsigned long lastStreamTime = 0; //To store the last streamed time stamp
5252
const int streamPeriod = 40; //To stream at 25Hz without using additional timers (time period(ms) =1000/frequency(Hz))
5353
bool updateSensorData = true; //Flag to update the sensor data. Default is true to perform the first read before the first stream
@@ -56,7 +56,7 @@ void setup() //This code is executed once
5656
{
5757
//Peripheral Initialization
5858
Serial.begin(115200); //Initialize the Serial Port to view information on the Serial Monitor
59-
I2C.begin(); //Initialize I2C communication to the let the library communicate with the sensor.
59+
I2C.begin(); //Initialize I2C communication to the let the library communicate with the sensor.
6060
//Sensor Initialization
6161
mySensor.initSensor(); //The I2C Address can be changed here inside this function in the library
6262
mySensor.setOperationMode(OPERATION_MODE_NDOF); //Can be configured to other operation modes as desired
@@ -142,4 +142,4 @@ void loop() //This code is looped forever
142142

143143
updateSensorData = true;
144144
}
145-
}
145+
}

‎examples/BareMinimum/BareMinimum.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
* patent rights of the copyright holder.
4545
*/
4646

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
4848
#include <Wire.h>
4949

50-
NAxisMotion mySensor; //Object that for the sensor
50+
NineAxesMotion mySensor; //Object that for the sensor
5151

5252
void setup() //This code is executed once
5353
{
@@ -61,4 +61,4 @@ void setup() //This code is executed once
6161
void loop() //This code is looped forever
6262
{
6363
//Blank
64-
}
64+
}

‎examples/Euler/Euler.ino

+14-14
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* notice, this list of conditions and the following disclaimer in the
2222
* documentation and/or other materials provided with the distribution.
2323
*
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
2626
* this software without specific prior written permission.
2727
*
2828
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@@ -35,39 +35,39 @@
3535
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3636
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3737
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
38-
*
38+
*
3939
* The information provided is believed to be accurate and reliable.
4040
* The copyright holder assumes no responsibility for the consequences of use
4141
* of such information nor for any infringement of patents or
4242
* other rights of third parties which may result from its use.
4343
* 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.
4545
*/
4646

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
4848
#include <Wire.h>
4949

50-
NAxisMotion mySensor; //Object that for the sensor
50+
NineAxesMotion mySensor; //Object that for the sensor
5151
unsigned long lastStreamTime = 0; //To store the last streamed time stamp
5252
const int streamPeriod = 20; //To stream at 50Hz without using additional timers (time period(ms) =1000/frequency(Hz))
5353

5454
void setup() //This code is executed once
55-
{
55+
{
5656
//Peripheral Initialization
5757
Serial.begin(115200); //Initialize the Serial Port to view information on the Serial Monitor
5858
I2C.begin(); //Initialize I2C communication to the let the library communicate with the sensor.
5959
//Sensor Initialization
6060
mySensor.initSensor(); //The I2C Address can be changed here inside this function in the library
6161
mySensor.setOperationMode(OPERATION_MODE_NDOF); //Can be configured to other operation modes as desired
6262
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
6464
}
6565

6666
void loop() //This code is looped forever
6767
{
6868
if ((millis() - lastStreamTime) >= streamPeriod)
6969
{
70-
lastStreamTime = millis();
70+
lastStreamTime = millis();
7171
mySensor.updateEuler(); //Update the Euler data into the structure of the object
7272
mySensor.updateCalibStatus(); //Update the Calibration Status
7373

@@ -86,19 +86,19 @@ void loop() //This code is looped forever
8686
Serial.print(" P: ");
8787
Serial.print(mySensor.readEulerPitch()); //Pitch data
8888
Serial.print("deg ");
89-
89+
9090
Serial.print(" A: ");
9191
Serial.print(mySensor.readAccelCalibStatus()); //Accelerometer Calibration Status (0 - 3)
92-
92+
9393
Serial.print(" M: ");
9494
Serial.print(mySensor.readMagCalibStatus()); //Magnetometer Calibration Status (0 - 3)
95-
95+
9696
Serial.print(" G: ");
9797
Serial.print(mySensor.readGyroCalibStatus()); //Gyroscope Calibration Status (0 - 3)
98-
98+
9999
Serial.print(" S: ");
100100
Serial.print(mySensor.readSystemCalibStatus()); //System Calibration Status (0 - 3)
101101

102102
Serial.println();
103103
}
104-
}
104+
}

‎examples/Motion/Motion.ino

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Date: 2014/09/09
66
* Revision: 2.0 $
77
*
8-
* Usage: Example code of a game to demonstrate the Any motion
8+
* Usage: Example code of a game to demonstrate the Any motion
99
* and No motion Interrupt features
1010
*
1111
****************************************************************************
@@ -45,10 +45,10 @@
4545
* patent rights of the copyright holder.
4646
*/
4747

48-
#include "NAxisMotion.h" //Contains the bridge code between the API and the Arduino Environment
48+
#include "NineAxesMotion.h" //Contains the bridge code between the API and the Arduino Environment
4949
#include <Wire.h>
5050

51-
NAxisMotion mySensor; //Object that for the sensor
51+
NineAxesMotion mySensor; //Object that for the sensor
5252
bool intDetected = false; //Flag to indicate if an interrupt was detected
5353
int threshold = 5; //At a Range of 4g, the threshold is set at 39.05mg or 0.3830m/s2. This Range is the default for NDOF Mode
5454
int duration = 1; //At a filter Bandwidth of 62.5Hz, the duration is 8ms. This Bandwidth is the default for NDOF Mode
@@ -77,7 +77,7 @@ void setup() //This code is executed once
7777
Serial.println("Move the Device from one place to another without triggering the Any Motion Interrupt.\n\n");
7878
delay(1000); //Delay for the player(s) to read
7979
Serial.println("Move the device around and then place it at one position.\nChange the threshold and duration to increase the difficulty level.");
80-
Serial.println("Have fun!\n\n");
80+
Serial.println("Have fun!\n\n");
8181
}
8282

8383
void loop() //This code is looped forever
@@ -109,4 +109,4 @@ void loop() //This code is looped forever
109109
void motionISR()
110110
{
111111
intDetected = true;
112-
}
112+
}

‎keywords.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
# Datatypes (KEYWORD1)
77
#######################################
88

9-
NAxisMotion KEYWORD1
9+
NineAxesMotion KEYWORD1
1010

1111
#######################################
1212
# Methods and Functions (KEYWORD2)
1313
#######################################
1414

15-
NAxisMotion KEYWORD2
15+
NineAxesMotion KEYWORD2
1616
initSensor KEYWORD2
1717
resetSensor KEYWORD2
1818
setOperationMode KEYWORD2

‎src/NAxisMotion.cpp ‎src/NineAxesMotion.cpp

+77-77
Large diffs are not rendered by default.

‎src/NAxisMotion.h ‎src/NineAxesMotion.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ struct bno055_accel_stat_t {
122122
#define POST_INIT_PERIOD 50 //Post initialization delay of 50ms
123123
#define MANUAL 1 //To manually call the update data functions
124124
#define AUTO 0 //To automatically call the update data functions
125-
class NAxisMotion {
125+
126+
class NineAxesMotion {
126127
private:
127128
bool dataUpdateMode; //Variable to store the mode of updating data
128129
struct bno055_t myBNO; //Structure that stores the device information
@@ -142,7 +143,7 @@ class NAxisMotion {
142143
*Input Parameters: None
143144
*Return Parameter: None
144145
*******************************************************************************************/
145-
NAxisMotion();
146+
NineAxesMotion();
146147

147148
/*******************************************************************************************
148149
*Description: Function with the bare minimum initialization
@@ -743,7 +744,7 @@ class NAxisMotion {
743744
/* QUATERNION */
744745
void readQuaternion(int16_t& w, int16_t& x, int16_t& y, int16_t& z);
745746
int16_t readQuaternion(int axis);
746-
void readQuat(float& w, int16_t& x, int16_t& y, int16_t& z);
747+
void readQuat(int16_t& w, int16_t& x, int16_t& y, int16_t& z);
747748
int16_t readQuat(int quaternion);
748749

749750
};

0 commit comments

Comments
 (0)
Please sign in to comment.