Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0ac12b9
Real Time Clock API - first draft
cmaglie Mar 18, 2016
dfe0136
Added motion interfaces
cmaglie Mar 24, 2016
0e1a28b
Fixed some typos
cmaglie Mar 24, 2016
67b8914
Added Rotation and Quaternion structures
cmaglie Mar 24, 2016
9924ebc
Renamed Motion.h -> MotionSense.h. Added some comments
cmaglie Mar 24, 2016
3eef53d
added Magnetometer class
cmaglie Mar 24, 2016
b66a1bb
Added some comments about units. Renamed Gyro -> Gyroscope
cmaglie Mar 25, 2016
4c1e94f
Correct quaternion order
cmaglie Mar 25, 2016
0a9804f
EulerAngles is a more appropriate name
cmaglie Mar 25, 2016
6e0ca14
Added Magnetometer.expectedMagneticFieldStrength() method
cmaglie Mar 25, 2016
0a96c9a
Added comment on EulerAngles units
cmaglie Mar 25, 2016
9be6359
No defaults FIFO methods for gyroscope.
cmaglie Mar 25, 2016
bde41a3
Added TimeProvider and related functions
cmaglie Apr 8, 2016
58dae9e
Added basic SoftwareRTC implementation.
cmaglie Apr 8, 2016
c400495
Add initial BLE API based on the BLEPeripheral library
sandeepmistry Apr 14, 2016
38424e2
Move BLE peripheral API into own folder
sandeepmistry Apr 26, 2016
49795df
Correct typo
sandeepmistry Apr 26, 2016
43c0daa
First draft of BLE central API
sandeepmistry Apr 26, 2016
4827027
Added a generic ArduinoAPI.h include folder with API version definitions
cmaglie Jun 9, 2016
4f8b4b2
Removed ARDUINO_REAL_TIME_CLOCK_API_VERSION
cmaglie Jun 9, 2016
e255e3d
Fixed return value on SoftwareRTC::setTime
cmaglie Jun 9, 2016
5bfc0cb
Add generic uint8_t RingBuffer class
facchinm Jul 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added some comments about units. Renamed Gyro -> Gyroscope
  • Loading branch information
cmaglie committed Mar 25, 2016
commit b66a1bb0b9259ed11d4a26d9be656c56450aed9c
30 changes: 17 additions & 13 deletions api/MotionSense.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,39 @@
#define ARDUINO_MOTION_SENSE_H

// Sensors that doesn't implement a FIFO can use the default
// implementation of availableXxx() and sampleRateXxx()
// implementation of availableXxx() and sampleRateXxx() and
// always return the last valid sample.

// Base class for accelerometers
class Accelerometer {
// read an acceleration sample from the FIFO or wait until one is available
// Read an acceleration sample from the FIFO or wait until one is available.
// Results are in G (earth gravity).
virtual bool readAcceleration(float &x, float &y, float &z) = 0;

// number of samples in the FIFO
// Number of samples in the FIFO.
virtual unsigned int availableAcceleration() { return 1; }

// sampling rate of the sensor
// Sampling rate of the sensor.
virtual unsigned long sampleRateAcceleration() { return 0; }
};

// Base class for gyro
class Gyro {
// read a gyro sample from the FIFO or wait until one is available
virtual bool readGyro(float &x, float &y, float &z) = 0;
// Base class for gyroscope
class Gyroscope {
// Read a gyro sample from the FIFO or wait until one is available.
// Results are in degrees/second.
virtual bool readGyroscope(float &x, float &y, float &z) = 0;

// number of samples in the FIFO
virtual unsigned int availableGyro() { return 1; }
// Number of samples in the FIFO.
virtual unsigned int availableGyroscope() { return 1; }

// sampling rate of the sensor
virtual unsigned long sampleRateGyro() { return 0; }
// Sampling rate of the sensor.
virtual unsigned long sampleRateGyroscope() { return 0; }
};

// Base class for magnetometers
class Magnetometer {
// read a magnetometer sample from the FIFO or wait until one is available
// Read a magnetometer sample from the FIFO or wait until one is available.
// Results are in uT (micro Tesla).
virtual bool readMagneticField(float &x, float &y, float &z) = 0;

// Number of samples in the FIFO.
Expand Down