From 94b83813739abbea9861f297fb3340523e5c5ded Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:48:12 +0100 Subject: [PATCH 1/9] begin() removed --- src/Arduino_SensorKit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Arduino_SensorKit.cpp b/src/Arduino_SensorKit.cpp index 7f9ebc6..64cdb46 100644 --- a/src/Arduino_SensorKit.cpp +++ b/src/Arduino_SensorKit.cpp @@ -9,7 +9,7 @@ SensorKit_BMP280 Pressure; SensorKit::SensorKit(){} bool SensorKit::begin(){ - Oled.begin(); + /*Oled.begin(); Oled.enableUTF8Print(); Accelerometer.begin(); @@ -17,9 +17,9 @@ bool SensorKit::begin(){ Accelerometer.setOutputDataRate(LIS3DHTR_DATARATE_50HZ); Pressure.begin(); - Environment.begin(); + Environment.begin();*/ } void SensorKit::end(){ -} \ No newline at end of file +} From 6997b78269c830b1ae6a47a51f84338be05378d1 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:52:09 +0100 Subject: [PATCH 2/9] Update Accelerometer.ino --- examples/Accelerometer/Accelerometer.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/Accelerometer/Accelerometer.ino b/examples/Accelerometer/Accelerometer.ino index 8ba7eaf..4a178e2 100644 --- a/examples/Accelerometer/Accelerometer.ino +++ b/examples/Accelerometer/Accelerometer.ino @@ -1,13 +1,11 @@ #include "Arduino_SensorKit.h" -SensorKit kit; - void setup() { // put your setup code here, to run once: Serial.begin(9600); while(!Serial); - kit.begin(); + Accelerometer.begin(); } void loop() { From 4488e05d6d29c3fbdec87faf5992cecccd8b7294 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:53:28 +0100 Subject: [PATCH 3/9] Update Oled_Display.ino --- examples/Oled_Display/Oled_Display.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/Oled_Display/Oled_Display.ino b/examples/Oled_Display/Oled_Display.ino index 4271ecc..e381907 100644 --- a/examples/Oled_Display/Oled_Display.ino +++ b/examples/Oled_Display/Oled_Display.ino @@ -1,9 +1,7 @@ #include "Arduino_SensorKit.h" -SensorKit kit; - void setup() { - kit.begin(); + Oled.begin(); } void loop() { From fa30d891fff8e8d2e9a0bf4e050a6fab3696aec3 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:53:57 +0100 Subject: [PATCH 4/9] Update Plug_Sketch_Play.ino --- examples/Plug_Sketch_Play/Plug_Sketch_Play.ino | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/Plug_Sketch_Play/Plug_Sketch_Play.ino b/examples/Plug_Sketch_Play/Plug_Sketch_Play.ino index 0c35680..e6db3c4 100644 --- a/examples/Plug_Sketch_Play/Plug_Sketch_Play.ino +++ b/examples/Plug_Sketch_Play/Plug_Sketch_Play.ino @@ -1,7 +1,5 @@ #include "Arduino_SensorKit.h" -SensorKit kit; - int button = 4; int LED = 6; @@ -10,8 +8,6 @@ void setup() { Serial.begin(9600); while (!Serial); - kit.begin(); - pinMode(button , INPUT); pinMode(LED, OUTPUT); From 43221ed0e761b79dbfc6490e5c1c125d7577c613 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:54:49 +0100 Subject: [PATCH 5/9] Update Pressure_Sensor.ino --- examples/Pressure_Sensor/Pressure_Sensor.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/Pressure_Sensor/Pressure_Sensor.ino b/examples/Pressure_Sensor/Pressure_Sensor.ino index 141d6d1..e371f5c 100644 --- a/examples/Pressure_Sensor/Pressure_Sensor.ino +++ b/examples/Pressure_Sensor/Pressure_Sensor.ino @@ -1,10 +1,8 @@ #include "Arduino_SensorKit.h" -SensorKit kit; - void setup() { Serial.begin(9600); - kit.begin(); + Pressure.begin(); } void loop() { From d83290d18b2a696c0940d97f5c1d1044bd01e064 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:55:22 +0100 Subject: [PATCH 6/9] Update Temp_and_Humidity.ino --- examples/Temp_and_Humidity/Temp_and_Humidity.ino | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/Temp_and_Humidity/Temp_and_Humidity.ino b/examples/Temp_and_Humidity/Temp_and_Humidity.ino index 272abfe..ae7a742 100644 --- a/examples/Temp_and_Humidity/Temp_and_Humidity.ino +++ b/examples/Temp_and_Humidity/Temp_and_Humidity.ino @@ -1,11 +1,9 @@ //#define DHTPIN 3 // By default its connected to pin D3, it can be changed, define it before the #include of the library #include "Arduino_SensorKit.h" -SensorKit kit; - void setup() { Serial.begin(9600); - kit.begin(); + Environment.begin(); } void loop() { From 6a061a313bd01c913b1b906caa49ef05ce5f1673 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Wed, 9 Dec 2020 14:56:39 +0100 Subject: [PATCH 7/9] Update library.properties --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 93e56b7..18246d1 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Arduino_Sensorkit -version=1.0.2 +version=1.0.3 author=Lenard George, Pablo Marquínez maintainer=Arduino sentence=Arduino Sensor Kit From 177173b7de7aeba36bfd4c845cdc459e774d4ea4 Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Thu, 10 Dec 2020 11:57:28 +0100 Subject: [PATCH 8/9] Add files via upload --- src/Arduino_SensorKit.cpp | 20 +------------------- src/Arduino_SensorKit.h | 12 ++---------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/Arduino_SensorKit.cpp b/src/Arduino_SensorKit.cpp index 64cdb46..8684e34 100644 --- a/src/Arduino_SensorKit.cpp +++ b/src/Arduino_SensorKit.cpp @@ -1,25 +1,7 @@ #include "Arduino_Sensorkit.h" //Declare component's classes -U8G2_SSD1306_128X64_NONAME_F_SW_I2C Oled(U8G2_R0, SCL, SDA, U8X8_PIN_NONE); +U8X8_SSD1306_128X64_NONAME_HW_I2C Oled(U8X8_PIN_NONE); DHT Environment(DHTPIN, DHTTYPE); SensorKit_LIS3DHTR Accelerometer; SensorKit_BMP280 Pressure; - -SensorKit::SensorKit(){} - -bool SensorKit::begin(){ - /*Oled.begin(); - Oled.enableUTF8Print(); - - Accelerometer.begin(); - delay(100); - Accelerometer.setOutputDataRate(LIS3DHTR_DATARATE_50HZ); - - Pressure.begin(); - Environment.begin();*/ -} - -void SensorKit::end(){ - -} diff --git a/src/Arduino_SensorKit.h b/src/Arduino_SensorKit.h index 010c4f2..3281a23 100644 --- a/src/Arduino_SensorKit.h +++ b/src/Arduino_SensorKit.h @@ -14,8 +14,7 @@ #include "Arduino_SensorKit_BMP280.h" // Pressure #include "Arduino_SensorKit_LIS3DHTR.h" // Accel #include "DHT.h" // Temp & Humidity -#include "U8g2lib.h" // Oled Display - +#include "U8x8lib.h" // Oled Display //Defines #ifndef DHTTYPE @@ -25,15 +24,8 @@ #define DHTPIN 3 #endif -class SensorKit { - public: - SensorKit(); - bool begin(); - void end(); -}; - //Make the declared components from the .cpp to the sketch available -extern U8G2_SSD1306_128X64_NONAME_F_SW_I2C Oled; +extern U8X8_SSD1306_128X64_NONAME_HW_I2C Oled; extern SensorKit_LIS3DHTR Accelerometer; extern SensorKit_BMP280 Pressure; extern DHT Environment; From f3ec99334985625d70a3225369b58b091f236a1a Mon Sep 17 00:00:00 2001 From: marqdevx <11246294+marqdevx@users.noreply.github.com> Date: Thu, 10 Dec 2020 11:58:49 +0100 Subject: [PATCH 9/9] Update Oled_Display.ino --- examples/Oled_Display/Oled_Display.ino | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/Oled_Display/Oled_Display.ino b/examples/Oled_Display/Oled_Display.ino index e381907..68b2a26 100644 --- a/examples/Oled_Display/Oled_Display.ino +++ b/examples/Oled_Display/Oled_Display.ino @@ -7,11 +7,11 @@ void setup() { void loop() { int random_value = random(0, 1023); //read value from A0 - Oled.clearBuffer(); // clear the internal memory - Oled.setFont(u8g2_font_ncenB08_tr); // choose a suitable font - Oled.setCursor(0, 10); - Oled.print("Analog Value:"); // write something to the internal memory - Oled.print(random_value); // print random value read from pin A0 - Oled.sendBuffer(); // transfer internal memory to the display + Oled.setFont(u8x8_font_chroma48medium8_r); + Oled.setCursor(0, 33); + Oled.print("Temp: "); + Oled.print(random_value); + Oled.print("C"); + Oled.refreshDisplay(); delay(1000); }