From ec509fc335bc763e7e05730be4b2023d1d8d6935 Mon Sep 17 00:00:00 2001 From: Malachi Burke Date: Tue, 18 Apr 2017 01:50:32 -0700 Subject: [PATCH 1/8] non-Arduino compatibility Should work with most standard C++ implementations --- Adafruit_Sensor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Adafruit_Sensor.h b/Adafruit_Sensor.h index 7742afc..1f25f0e 100644 --- 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 From 1e2482f85510d8a217b23a122183cfd23793d38d Mon Sep 17 00:00:00 2001 From: DoNck Date: Thu, 21 Sep 2017 11:03:17 +0200 Subject: [PATCH 2/8] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a4cd6ae..41f0723 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,11 @@ The following drivers are based on the Adafruit Unified Sensor Driver: **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: From c2358294eba4b071db2a4632c2817af2778f7e7a Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Sat, 17 Feb 2018 10:59:28 -0200 Subject: [PATCH 3/8] Adding a .gitignore to the project --- .gitignore | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .gitignore 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 + From 9138c60af74f7f868691aebb00a6dbc4a723edf0 Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Sat, 17 Feb 2018 11:00:56 -0200 Subject: [PATCH 4/8] Fixes an ISO-8859-1 vs UTF-8 issue Files should be enconded with UTF-8, ISO-8859-1 and variants are outdated. This patch fixes an issue with the degree sign, which was coded in ISO-8859-1 rather than UTF-8. --- Adafruit_Sensor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 Adafruit_Sensor.h diff --git a/Adafruit_Sensor.h b/Adafruit_Sensor.h old mode 100644 new mode 100755 index 7742afc..fbd5639 --- a/Adafruit_Sensor.h +++ b/Adafruit_Sensor.h @@ -72,9 +72,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; From 01c5133ecc26ba752ba5dc70044a4391da7d4246 Mon Sep 17 00:00:00 2001 From: Phil Dubach Date: Mon, 17 Sep 2018 11:23:46 -0700 Subject: [PATCH 5/8] Suppress unused argument warning in enableAutoRange() --- Adafruit_Sensor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_Sensor.h b/Adafruit_Sensor.h index 7742afc..f93c3cd 100644 --- a/Adafruit_Sensor.h +++ b/Adafruit_Sensor.h @@ -143,7 +143,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; From 418efaa53f502ace47b2f94dcc6eca4ee77bd0c7 Mon Sep 17 00:00:00 2001 From: Adam Patridge Date: Tue, 25 Sep 2018 07:38:28 -0700 Subject: [PATCH 6/8] Include Adafruit BME280 driver in list. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 41f0723..fd99597 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ 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) From 073746a60bde9ac28a0454de7a7fec2729aa30dc Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Mon, 11 Mar 2019 10:08:54 -0400 Subject: [PATCH 7/8] Adding the includes line to the library.properties This line allows the Arduino framework to discover that this library provides this header file. --- library.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/library.properties b/library.properties index fa7eefa..b3a2ece 100644 --- a/library.properties +++ b/library.properties @@ -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 From 6f4785cd498f07144a3f5c4e452aaa238c0a7c36 Mon Sep 17 00:00:00 2001 From: "Limor \"Ladyada\" Fried" Date: Mon, 11 Mar 2019 11:37:28 -0400 Subject: [PATCH 8/8] Update library.properties --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index b3a2ece..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.