From ff59149ac0ac8593e4fc7fad0daa8d4c65291cd3 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Fri, 11 Dec 2020 16:50:23 +0100 Subject: [PATCH 1/9] update to 1.0.5 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index c6ff964..a87982c 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Arduino_Sensorkit -version=1.0.4 +version=1.0.5 author=Lenard George, Pablo Marquínez maintainer=Arduino sentence=Arduino Sensor Kit From 9f5a5b86b22767c4fb106758af25206d2ec5db5b Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Fri, 11 Dec 2020 16:50:46 +0100 Subject: [PATCH 2/9] display changed to SW i2c --- src/Arduino_SensorKit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arduino_SensorKit.cpp b/src/Arduino_SensorKit.cpp index 8684e34..39e3182 100644 --- a/src/Arduino_SensorKit.cpp +++ b/src/Arduino_SensorKit.cpp @@ -1,7 +1,7 @@ #include "Arduino_Sensorkit.h" //Declare component's classes -U8X8_SSD1306_128X64_NONAME_HW_I2C Oled(U8X8_PIN_NONE); +U8X8_SSD1306_128X64_NONAME_SW_I2C Oled(U8X8_PIN_NONE); DHT Environment(DHTPIN, DHTTYPE); SensorKit_LIS3DHTR Accelerometer; SensorKit_BMP280 Pressure; From aa3c44f8397d4752ee50da6fa08fcaa2eb77edb1 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Fri, 11 Dec 2020 16:51:04 +0100 Subject: [PATCH 3/9] display changed to SW i2c --- src/Arduino_SensorKit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arduino_SensorKit.h b/src/Arduino_SensorKit.h index 3281a23..a4bb6cb 100644 --- a/src/Arduino_SensorKit.h +++ b/src/Arduino_SensorKit.h @@ -25,7 +25,7 @@ #endif //Make the declared components from the .cpp to the sketch available -extern U8X8_SSD1306_128X64_NONAME_HW_I2C Oled; +extern U8X8_SSD1306_128X64_NONAME_SW_I2C Oled; extern SensorKit_LIS3DHTR Accelerometer; extern SensorKit_BMP280 Pressure; extern DHT Environment; From f09db8729ae954fbc00e0978f5f2cec7fec654bf Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Fri, 11 Dec 2020 16:53:45 +0100 Subject: [PATCH 4/9] Update Arduino_SensorKit.cpp --- src/Arduino_SensorKit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arduino_SensorKit.cpp b/src/Arduino_SensorKit.cpp index 39e3182..878cdc1 100644 --- a/src/Arduino_SensorKit.cpp +++ b/src/Arduino_SensorKit.cpp @@ -1,7 +1,7 @@ #include "Arduino_Sensorkit.h" //Declare component's classes -U8X8_SSD1306_128X64_NONAME_SW_I2C Oled(U8X8_PIN_NONE); +U8X8_SSD1306_128X64_NONAME_SW_I2C Oled(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); DHT Environment(DHTPIN, DHTTYPE); SensorKit_LIS3DHTR Accelerometer; SensorKit_BMP280 Pressure; From 54fbb0d95b857a7325c40e16821ae1f0891ccf3e Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Sat, 12 Dec 2020 11:38:36 +0100 Subject: [PATCH 5/9] include fix --- src/Arduino_SensorKit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arduino_SensorKit.cpp b/src/Arduino_SensorKit.cpp index 878cdc1..0c2a7c1 100644 --- a/src/Arduino_SensorKit.cpp +++ b/src/Arduino_SensorKit.cpp @@ -1,4 +1,4 @@ -#include "Arduino_Sensorkit.h" +#include "Arduino_SensorKit.h" //Declare component's classes U8X8_SSD1306_128X64_NONAME_SW_I2C Oled(/* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); From ee30aacc2b4cc89ce2744c1c637741c3d06a1559 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Sat, 12 Dec 2020 11:44:57 +0100 Subject: [PATCH 6/9] added rotation --- examples/Oled_Display/Oled_Display.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Oled_Display/Oled_Display.ino b/examples/Oled_Display/Oled_Display.ino index 68b2a26..fa3caa8 100644 --- a/examples/Oled_Display/Oled_Display.ino +++ b/examples/Oled_Display/Oled_Display.ino @@ -2,6 +2,7 @@ void setup() { Oled.begin(); + Oled.setFlipMode(true); } void loop() { From 936a85e6fdff43cc894a1e70351564b054279528 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Sat, 12 Dec 2020 11:45:34 +0100 Subject: [PATCH 7/9] update 1.0.6 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index a87982c..717b7f1 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Arduino_Sensorkit -version=1.0.5 +version=1.0.6 author=Lenard George, Pablo Marquínez maintainer=Arduino sentence=Arduino Sensor Kit From 1fe9de27adf7db79da03d2e1530b2cdd55214617 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Sat, 12 Dec 2020 11:46:21 +0100 Subject: [PATCH 8/9] update 1.0.5 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 717b7f1..a87982c 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Arduino_Sensorkit -version=1.0.6 +version=1.0.5 author=Lenard George, Pablo Marquínez maintainer=Arduino sentence=Arduino Sensor Kit From ec07186fc831270b18fb28d67f1cbd02d31eca10 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Wed, 16 Dec 2020 11:59:04 +0100 Subject: [PATCH 9/9] Update readme.md --- docs/readme.md | 92 +++++++++++++++----------------------------------- 1 file changed, 28 insertions(+), 64 deletions(-) diff --git a/docs/readme.md b/docs/readme.md index 2ae56d3..319c5ec 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -10,35 +10,15 @@ The Arduino_SensorKit Library can be downloaded from the Arduino IDE’s library # Classes -## SensorKit class - -### Declaration +## Including the library ```cpp #include "Arduino_SensorKit.h" - SensorKit kit; //Declare the object to use it later - void setup(){} void loop(){} ``` -### Initialization - -Using the function `begin()` at the beginning of the `setup()` - -```cpp - #include "Arduino_SensorKit.h" - - SensorKit kit; //Declare the object to use it later - - void setup(){ - kit.begin(); - } - - void loop(){} -``` - ## OLED Using the Grove - OLED Display 0.96 inch @@ -47,29 +27,25 @@ Using the Grove - OLED Display 0.96 inch Init and returns true if success, already done in the `SensorKit`'s object `begin()` ```cpp -if(!Oled.begin()){ - Serial.println("Error"); - while(1); -} -Serial.println("Ok"); + void setup(){ + Oled.begin(); + } + void loop(){} ``` ### Printing "hello world" ```cpp #include "Arduino_SensorKit.h" -SensorKit kit; - void setup() { - kit.begin(); + Oled.begin(); + Oled.setFlipMode(1); //Rotate it } void loop() { - Oled.clearBuffer(); // clear the internal memory - Oled.setFont(u8g2_font_ncenB08_tr); // choose a suitable font - Oled.setCursor(0, 10); - Oled.print("Hello World"); // write something to the internal memory - Oled.sendBuffer(); // transfer internal memory to the display + Oled.setFont(u8x8_font_chroma48medium8_r); + Oled.drawString(0,0,"Hello World!"); + Oled.refreshDisplay(); // only required for SSD1606/7 delay(1000); } ``` @@ -77,7 +53,7 @@ void loop() { ### Printing values ```cpp -Oled.print(value); + Oled.print(value); ``` ## Accelerometer @@ -88,24 +64,21 @@ Using the Grove - 3-Axis Digital Accelerometer (±1.5g) Init and returns true if success, already done in the `SensorKit`'s object `begin()` ```cpp - if (!Accelerometer.begin()){ - Serial.println("Error"); // Accelerometer didnt initialized - while(1); // Stop the program + void setup(){ + Accelerometer.begin(); } - Serial.println("Init complete"); + void loop(){} ``` ### Reading the Acceleration X ```cpp #include "Arduino_SensorKit.h" - - SensorKit kit; //Declare the object to use it later - + float acceleration; void setup(){ - kit.begin(); + Accelerometer.begin(); } void loop(){ @@ -119,13 +92,12 @@ Init and returns true if success, already done in the `SensorKit`'s object `begi ```cpp #include "Arduino_SensorKit.h" - SensorKit kit; float x,y,z; // Values for the readings setup(){ Serial.begin(9600); - kit.begin(); + Accelerometer.begin(); } loop{ @@ -145,13 +117,12 @@ Return if the sensor its good to give the data ```cpp #include "Arduino_SensorKit.h" - SensorKit kit; float x,y,z; // Values for the readings setup(){ Serial.begin(9600); - kit.begin(); + Accelerometer.begin(); } loop{ @@ -169,24 +140,22 @@ The Pressure sensor can get temperature, pressure and altitude ### Initialising the sensor Init and returns true if success, already done in the `SensorKit`'s object `begin()` ```cpp - if (!Pressure.begin()){ - Serial.println("Error"); // Accelerometer didnt initialized - while(1); // Stop the program + void setup(){ + Pressure.begin(); } - Serial.println("Init complete"); + void loop(){} ``` ### Reading the Temperature values ```cpp #include "Arduino_SensorKit.h" - SensorKit kit; float temperature; // Value for the reading setup(){ Serial.begin(9600); - kit.begin(); + Pressure.begin(); } loop{ @@ -200,13 +169,12 @@ Init and returns true if success, already done in the `SensorKit`'s object `begi ```cpp #include "Arduino_SensorKit.h" - SensorKit kit; uint32_t pressure; // Value for the reading setup(){ Serial.begin(9600); - kit.begin(); + Pressure.begin(); } loop{ @@ -219,13 +187,12 @@ Init and returns true if success, already done in the `SensorKit`'s object `begi ### Reading the Altitude values ```cpp #include "Arduino_SensorKit.h" - SensorKit kit; float altitude; // Value for the reading setup(){ Serial.begin(9600); - kit.begin(); + Presure.begin(); } loop{ @@ -247,24 +214,22 @@ By default, once you include the library it has been set to digital pin `3`, it ### Initialising the sensor ```cpp - if (!Environment.begin()){ - Serial.println("Error"); // Accelerometer didnt initialized - while(1); // Stop the program + void setup(){ + Environment.begin(); } - Serial.println("Init complete"); + void loop(){} ``` ### Reading the Temperature values ```cpp #include "Arduino_SensorKit.h" - SensorKit kit; float temperature; void setup() { Serial.begin(9600); - kit.begin(); + Environment.begin(); } void loop() { @@ -279,7 +244,6 @@ By default, once you include the library it has been set to digital pin `3`, it ```cpp #include "Arduino_SensorKit.h" - SensorKit kit; float humidity;