diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d04184a --- /dev/null +++ b/.gitignore @@ -0,0 +1,108 @@ +# +# NOTE! Don't add files that are generated in specific +# subdirectories here. Add them in the ".gitignore" file +# in that subdirectory instead. +# +# NOTE! Please use 'git ls-files -i --exclude-standard' +# command after changing this file, to see if there are +# any tracked files which get ignored after the change. +# +# Normal rules +# +.* +*.o +*.o.* +*.a +*.s +*.ko +*.so +*.so.dbg +*.mod.c +*.i +*.lst +*.symtypes +*.order +modules.builtin +*.elf +*.bin +*.gz +*.bz2 +*.lzma +*.patch +*.gcno + +# +# Top-level generic files +# +/tags +/TAGS +/linux +/vmlinux +/vmlinuz +/System.map +/Module.markers +/Module.symvers + +# +# git files that we don't want to ignore even it they are dot-files +# +!.gitignore +!.mailmap + +# +# Generated include files +# +include/config +include/linux/version.h +include/generated + +# stgit generated dirs +patches-* + +# quilt's files +patches +series + +# cscope files +cscope.* +ncscope.* + +# gnu global files +GPATH +GRTAGS +GSYMS +GTAGS + +# QT-Creator files +Makefile.am.user +*.config +*.creator +*.creator.user +*.files +*.includes + +*.orig +*~ +\#*# +*.lo +*.la +Makefile +Makefile.in +aclocal.m4 +autoconfig.h +autoconfig.h.in +autom4te.cache/ +build-aux/ +config.log +config.status +configure +libtool +libupnp.pc +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 +stamp-h1 +docs/doxygen + diff --git a/Adafruit_Sensor.h b/Adafruit_Sensor.h old mode 100644 new mode 100755 index d01bca8..d6e2cae --- a/Adafruit_Sensor.h +++ b/Adafruit_Sensor.h @@ -20,7 +20,9 @@ #ifndef _ADAFRUIT_SENSOR_H #define _ADAFRUIT_SENSOR_H -#if ARDUINO >= 100 +#ifndef ARDUINO + #include +#elif ARDUINO >= 100 #include "Arduino.h" #include "Print.h" #else @@ -73,9 +75,9 @@ typedef struct { }; /* Orientation sensors */ struct { - float roll; /**< Rotation around the longitudinal axis (the plane body, 'X axis'). Roll is positive and increasing when moving downward. -90°<=roll<=90° */ - float pitch; /**< Rotation around the lateral axis (the wing span, 'Y axis'). Pitch is positive and increasing when moving upwards. -180°<=pitch<=180°) */ - float heading; /**< Angle between the longitudinal axis (the plane body) and magnetic north, measured clockwise when viewing from the top of the device. 0-359° */ + float roll; /**< Rotation around the longitudinal axis (the plane body, 'X axis'). Roll is positive and increasing when moving downward. -90°<=roll<=90° */ + float pitch; /**< Rotation around the lateral axis (the wing span, 'Y axis'). Pitch is positive and increasing when moving upwards. -180°<=pitch<=180°) */ + float heading; /**< Angle between the longitudinal axis (the plane body) and magnetic north, measured clockwise when viewing from the top of the device. 0-359° */ }; }; int8_t status; @@ -144,7 +146,7 @@ class Adafruit_Sensor { virtual ~Adafruit_Sensor() {} // These must be defined by the subclass - virtual void enableAutoRange(bool enabled) {}; + virtual void enableAutoRange(bool enabled) { (void)enabled; /* suppress unused warning */ }; virtual bool getEvent(sensors_event_t*) = 0; virtual void getSensor(sensor_t*) = 0; diff --git a/README.md b/README.md index a4cd6ae..fd99597 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,17 @@ The following drivers are based on the Adafruit Unified Sensor Driver: **Humidity & Temperature** - [DHT-sensor-library](https://github.com/adafruit/DHT-sensor-library) +**Humidity, Temperature, & Barometric Pressure** + - [Adafruit_BME280_Library](https://github.com/adafruit/Adafruit_BME280_Library/) + **Orientation** - [Adafruit_BNO055](https://github.com/adafruit/Adafruit_BNO055) +**All in one device** +- [Adafruit_LSM9DS0](https://github.com/adafruit/Adafruit_LSM9DS0_Library) (accelerometer, gyroscope, magnetometer) +- [Adafruit_LSM9DS1](https://github.com/adafruit/Adafruit_LSM9DS1/) (accelerometer, gyroscope, magnetometer) + + ## How Does it Work? ## Any driver that supports the Adafruit unified sensor abstraction layer will implement the Adafruit\_Sensor base class. There are two main typedefs and one enum defined in Adafruit_Sensor.h that are used to 'abstract' away the sensor details and values: diff --git a/library.properties b/library.properties index fa7eefa..e0bcd3e 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit Unified Sensor -version=1.0.2 +version=1.0.3 author=Adafruit maintainer=Adafruit sentence=Required for all Adafruit Unified Sensor based libraries. @@ -7,3 +7,4 @@ paragraph=A unified sensor abstraction layer used by many Adafruit sensor librar category=Sensors url=https://github.com/adafruit/Adafruit_Sensor architectures=* +includes=Adafruit_Sensor.h