From a8b6d5dad4e70fdbeed36cbd5c6154ff164cbdaa Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 12 Apr 2021 06:59:12 -0700 Subject: [PATCH 1/6] Configure Dependabot to check for outdated actions used in workflows Dependabot will periodically check the versions of all actions used in the repository's workflows. If any are found to be outdated, it will submit a pull request to update them. NOTE: Dependabot's PRs will sometimes try to pin to the patch version of the action (e.g., updating `uses: foo/bar@v1` to `uses: foo/bar@v2.3.4`). When the action author has provided a major version ref, use that instead (e.g., `uses: foo/bar@v2`). Dependabot will automatically close its PR once the workflow has been updated. More information: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..03600dd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file +version: 2 + +updates: + # Configure check for outdated GitHub Actions actions in workflows. + # See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: github-actions + directory: / # Check the repository's workflows under /.github/workflows/ + schedule: + interval: daily From 145d559df9b3332a5e088d91a46df06e3549bc16 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 12 Apr 2021 06:59:42 -0700 Subject: [PATCH 2/6] Add CI workflow to check for commonly misspelled words On every push, pull request, and periodically, use the codespell-project/actions-codespell action to check for commonly misspelled words. In the event of a false positive, the problematic word should be added, in all lowercase, to the ignore-words-list field of ./.codespellrc. Regardless of the case of the word in the false positive, it must be in all lowercase in the ignore list. The ignore list is comma-separated with no spaces. --- .codespellrc | 7 +++++++ .github/workflows/spell-check.yml | 22 ++++++++++++++++++++++ README.md | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 .codespellrc create mode 100644 .github/workflows/spell-check.yml diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..101edae --- /dev/null +++ b/.codespellrc @@ -0,0 +1,7 @@ +# See: https://github.com/codespell-project/codespell#using-a-config-file +[codespell] +# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: +ignore-words-list = , +check-filenames = +check-hidden = +skip = ./.git diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..01bee87 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,22 @@ +name: Spell Check + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + pull_request: + schedule: + # Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates. + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + +jobs: + spellcheck: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Spell check + uses: codespell-project/actions-codespell@master diff --git a/README.md b/README.md index 0d94e2b..cd90618 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Arduino Sensorkit Library +[![Spell Check status](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/spell-check.yml) + This documentation contains information about the classes and the usage of Arduino_SensorKit library which is primarily used in the [Arduino Sensor Kit](https://store.arduino.cc/sensor-kit-base). This library is a wrapper for other libraries such as * [u8g2](https://github.com/olikraus/U8g2_Arduino) Library for monochrome displayes From 73f9f98f3fd02714f5a0663b653ba9e837a25d53 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 12 Apr 2021 07:37:55 -0700 Subject: [PATCH 3/6] Add CI workflow to do Arduino project-specific linting On every push, pull request, and periodically, run Arduino Lint to check for common problems not related to the project code. --- .github/workflows/check-arduino.yml | 28 ++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/check-arduino.yml diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml new file mode 100644 index 0000000..0d969f6 --- /dev/null +++ b/.github/workflows/check-arduino.yml @@ -0,0 +1,28 @@ +name: Check Arduino + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + pull_request: + schedule: + # Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint. + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Arduino Lint + uses: arduino/arduino-lint-action@v1 + with: + compliance: specification + library-manager: update + # Always use this setting for official repositories. Remove for 3rd party projects. + official: true + project-type: library diff --git a/README.md b/README.md index cd90618..66e2d09 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Arduino Sensorkit Library +[![Check Arduino status](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/check-arduino.yml) [![Spell Check status](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/spell-check.yml) This documentation contains information about the classes and the usage of Arduino_SensorKit library which is primarily used in the [Arduino Sensor Kit](https://store.arduino.cc/sensor-kit-base). This library is a wrapper for other libraries such as From d3f7863cb81d7525a9fbd19698be990b39dcd125 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 12 Apr 2021 07:38:38 -0700 Subject: [PATCH 4/6] Add "smoke test" examples compilation CI workflow On every push or pull request that affects library source or example files, and periodically, compile all example sketches for the specified boards. --- .github/workflows/compile-examples.yml | 65 ++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/compile-examples.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 0000000..92a5279 --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,65 @@ +name: Compile Examples + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/compile-examples.yml" + - "examples/**" + - "src/**" + pull_request: + paths: + - ".github/workflows/compile-examples.yml" + - "examples/**" + - "src/**" + schedule: + # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms). + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + +jobs: + build: + name: ${{ matrix.board.fqbn }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:avr:uno + platforms: | + - name: arduino:avr + - fqbn: arduino:avr:mega + platforms: | + - name: arduino:avr + - fqbn: arduino:avr:leonardo + platforms: | + - name: arduino:avr + - fqbn: arduino:megaavr:uno2018 + platforms: | + - name: arduino:megaavr + - fqbn: arduino:samd:arduino_zero_edbg + platforms: | + - name: arduino:samd + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Compile examples + uses: arduino/compile-sketches@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + fqbn: ${{ matrix.board.fqbn }} + platforms: ${{ matrix.board.platforms }} + libraries: | + # Install the library from the local path. + - source-path: ./ + - name: DHT sensor library + - name: Grove-3-Axis-Digital-Accelerometer-2g-to-16g-LIS3DHTR + - name: Grove - Barometer Sensor BMP280 + - name: U8g2 + sketch-paths: | + - examples diff --git a/README.md b/README.md index 66e2d09..c9d1cba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Arduino Sensorkit Library [![Check Arduino status](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/check-arduino.yml) +[![Compile Examples status](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/compile-examples.yml) [![Spell Check status](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/spell-check.yml) This documentation contains information about the classes and the usage of Arduino_SensorKit library which is primarily used in the [Arduino Sensor Kit](https://store.arduino.cc/sensor-kit-base). This library is a wrapper for other libraries such as From 8cabe245513d7d46a7bbf3c7370a4d924bc4f510 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 12 Apr 2021 07:38:55 -0700 Subject: [PATCH 5/6] Report changes in memory usage that would result from merging a PR On creation or commit to a pull request, a report of the resulting change in memory usage of the examples will be commented to the PR thread. --- .github/workflows/compile-examples.yml | 12 ++++++++++++ .github/workflows/report-size-deltas.yml | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 92a5279..ca92c85 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -23,6 +23,9 @@ jobs: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest + env: + SKETCHES_REPORTS_PATH: sketches-reports + strategy: fail-fast: false @@ -63,3 +66,12 @@ jobs: - name: U8g2 sketch-paths: | - examples + enable-deltas-report: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + + - name: Save sketches report as workflow artifact + uses: actions/upload-artifact@v2 + with: + if-no-files-found: error + path: ${{ env.SKETCHES_REPORTS_PATH }} + name: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..652be5d --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/report-size-deltas.yml" + schedule: + # Run at the minimum interval allowed by GitHub Actions. + # Note: GitHub Actions periodically has outages which result in workflow failures. + # In this event, the workflows will start passing again once the service recovers. + - cron: "*/5 * * * *" + workflow_dispatch: + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the sketch compilation workflow + sketches-reports-source: sketches-reports From 947294d83f764a4039fd74fb1ddb8e7bc86973b3 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 13 Apr 2021 22:31:17 -0700 Subject: [PATCH 6/6] Correct typos in comments and documentation --- README.md | 6 +++--- docs/readme.md | 12 ++++++------ examples/Combined_Demo/Combined_Demo.ino | 2 +- examples/Pressure_Sensor/Pressure_Sensor.ino | 2 +- keywords.txt | 2 +- src/Arduino_SensorKit.h | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c9d1cba..9978c4d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Arduino Sensorkit Library +# Arduino SensorKit Library [![Check Arduino status](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/check-arduino.yml) [![Compile Examples status](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_SensorKit/actions/workflows/compile-examples.yml) @@ -6,9 +6,9 @@ This documentation contains information about the classes and the usage of Arduino_SensorKit library which is primarily used in the [Arduino Sensor Kit](https://store.arduino.cc/sensor-kit-base). This library is a wrapper for other libraries such as -* [u8g2](https://github.com/olikraus/U8g2_Arduino) Library for monochrome displayes +* [u8g2](https://github.com/olikraus/U8g2_Arduino) Library for monochrome displays * [Seeed_Arduino_LIS3DHTR](https://github.com/Seeed-Studio/Seeed_Arduino_LIS3DHTR) for the 3 Axis Accelerometer * [Grove_BMP280](https://github.com/Seeed-Studio/Grove_BMP280) Library for the Barometer * [DHT-sensor-library](https://github.com/adafruit/DHT-sensor-library) for the Temperature and Humidity Sensor -The Arduino_SensorKit Library can be downloaded from the Arduino IDE’s library manager or from the github repository +The Arduino_SensorKit Library can be downloaded from the Arduino IDE's library manager or from the GitHub repository. diff --git a/docs/readme.md b/docs/readme.md index c430af6..57028b3 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,12 +1,12 @@ # **Sensor Kit Reference** This documentation contains information about the classes and the usage of **Arduino_SensorKit** library which is primarily used in the [Arduino Sensor Kit](https://sensorkit.arduino.cc/). This library is a wrapper for other libraries such as -* [u8g2 Library for monochrome displayes](https://github.com/olikraus/u8g2) +* [u8g2 Library for monochrome displays](https://github.com/olikraus/u8g2) * [Seeed_Arduino_LIS3DHTR for the 3 Axis Accelerometer](https://github.com/Seeed-Studio/Seeed_Arduino_LIS3DHTR) * [Grove_BMP280 Library for the Barometer](https://github.com/Seeed-Studio/Grove_BMP280) * [DHT-sensor-library for the Temperature and Humidity Sensor](https://github.com/adafruit/DHT-sensor-library) -The Arduino_SensorKit Library can be downloaded from the Arduino IDE’s library manager or from the [github repository](https://github.com/arduino-libraries/Arduino_SensorKit) +The Arduino_SensorKit Library can be downloaded from the Arduino IDE's Library Manager or from the [GitHub repository](https://github.com/arduino-libraries/Arduino_SensorKit) # Classes @@ -22,7 +22,7 @@ The Arduino_SensorKit Library can be downloaded from the Arduino IDE’s library ## OLED Using the Grove - OLED Display 0.96 inch -### Initialising the driver +### Initializing the driver Init the display driver @@ -59,7 +59,7 @@ void loop() { ## Accelerometer Using the Grove - 3-Axis Digital Accelerometer (±1.5g) -### Initialising the sensor +### Initializing the sensor Initialize the sensor @@ -137,7 +137,7 @@ Return if the sensor its good to give the data Using the Grove Barometer Sensor (BMP280) The Pressure sensor can get temperature, pressure and altitude -### Initialising the sensor +### Initializing the sensor Initialize the sensor ```cpp void setup(){ @@ -212,7 +212,7 @@ By default, once you include the library it has been set to digital pin `3`, it #define DHTPIN yourPin ``` -### Initialising the sensor +### Initializing the sensor ```cpp void setup(){ Environment.begin(); diff --git a/examples/Combined_Demo/Combined_Demo.ino b/examples/Combined_Demo/Combined_Demo.ino index e1ffc7d..464e270 100644 --- a/examples/Combined_Demo/Combined_Demo.ino +++ b/examples/Combined_Demo/Combined_Demo.ino @@ -1,6 +1,6 @@ // Combined Demo by Marc MERLIN // Reviewed by Pablo Marquínez -// This demo use all the devices from the Arduino SensorKit +// This demo uses all the devices from the Arduino Sensor Kit // Showing the values on the Display #include "Arduino_SensorKit.h" diff --git a/examples/Pressure_Sensor/Pressure_Sensor.ino b/examples/Pressure_Sensor/Pressure_Sensor.ino index e371f5c..1279cb4 100644 --- a/examples/Pressure_Sensor/Pressure_Sensor.ino +++ b/examples/Pressure_Sensor/Pressure_Sensor.ino @@ -9,7 +9,7 @@ void loop() { // Get and print temperatures Serial.print("Temp: "); Serial.print(Pressure.readTemperature()); - Serial.println("C"); // The unit for Celsius because original arduino don't support speical symbols + Serial.println("C"); // The unit for Celsius because original Arduino don't support special symbols // Get and print atmospheric pressure data Serial.print("Pressure: "); diff --git a/keywords.txt b/keywords.txt index 14a5511..07d3ab0 100644 --- a/keywords.txt +++ b/keywords.txt @@ -1,5 +1,5 @@ ####################################### -# Syntax Coloring Map of SensorKit +# Syntax Coloring Map of Arduino_SensorKit ####################################### ####################################### diff --git a/src/Arduino_SensorKit.h b/src/Arduino_SensorKit.h index 3281a23..8113ecb 100644 --- a/src/Arduino_SensorKit.h +++ b/src/Arduino_SensorKit.h @@ -14,7 +14,7 @@ #include "Arduino_SensorKit_BMP280.h" // Pressure #include "Arduino_SensorKit_LIS3DHTR.h" // Accel #include "DHT.h" // Temp & Humidity -#include "U8x8lib.h" // Oled Display +#include "U8x8lib.h" // OLED Display //Defines #ifndef DHTTYPE