Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add generic byte RingBuffer class #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
facchinm wants to merge 22 commits into arduino:master from facchinm:RingBuffer
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
Renamed Motion.h -> MotionSense.h. Added some comments
  • Loading branch information
cmaglie committed Mar 24, 2016
commit 9924ebc098bca34ad131d003f18aed41d7a34f1d
23 changes: 19 additions & 4 deletions api/Motion.h → api/MotionSense.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,31 @@
#ifndef ARDUINO_MOTION_SENSE_H
#define ARDUINO_MOTION_SENSE_H

// Sensors that doesn't implement a FIFO can use the default
// implementation of availableXxx() and sampleRateXxx()

// Base class for accelerometers
class Accelerometer {
// read an acceleration sample from the FIFO or wait until one is available
virtual bool readAcceleration(float &x, float &y, float &z) = 0;
virtual unsigned int availableAcceleration() = 0;
virtual unsigned long sampleRateAcceleration() = 0;

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

// 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;
virtual unsigned int availableGyro() = 0;
virtual unsigned long sampleRateGyro() = 0;

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

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

struct Rotation {
Expand Down

AltStyle によって変換されたページ (->オリジナル) /