diff --git a/libraries/MTP40F/CHANGELOG.md b/libraries/MTP40F/CHANGELOG.md index e64895d3..bab5bc80 100644 --- a/libraries/MTP40F/CHANGELOG.md +++ b/libraries/MTP40F/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.2] - 2023-11-14 +- update readme.md + + ## [0.1.1] - 2023-08-02 - fix **getGasConcentration()** status handling - update readme.md @@ -16,7 +20,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - add default value to **setSelfCalibrationHours(hours = 168)** - update examples - ## [0.1.0] - 2023-07-25 - initial version. diff --git a/libraries/MTP40F/MTP40F.cpp b/libraries/MTP40F/MTP40F.cpp index e40027c8..e93f5acc 100644 --- a/libraries/MTP40F/MTP40F.cpp +++ b/libraries/MTP40F/MTP40F.cpp @@ -2,7 +2,7 @@ // FILE: MTP40F.cpp // AUTHOR: Rob Tillaart // DATE: 2023-07-25 -// VERSION: 0.1.1 +// VERSION: 0.1.2 // PURPOSE: Arduino library for MTP40F CO2 sensor // URL: https://github.com/RobTillaart/MTP40F @@ -211,7 +211,7 @@ int MTP40F::lastError() ////////////////////////////////////////////////////////////////////// // -// PRIVATE +// PROTECTED // bool MTP40F::request(uint8_t *data, uint8_t commandLength, uint8_t responseLength) { diff --git a/libraries/MTP40F/MTP40F.h b/libraries/MTP40F/MTP40F.h index 0821b90d..0f627882 100644 --- a/libraries/MTP40F/MTP40F.h +++ b/libraries/MTP40F/MTP40F.h @@ -3,7 +3,7 @@ // FILE: MTP40F.h // AUTHOR: Rob Tillaart // DATE: 2023-07-25 -// VERSION: 0.1.1 +// VERSION: 0.1.2 // PURPOSE: Arduino library for MTP40F CO2 sensor // URL: https://github.com/RobTillaart/MTP40F @@ -11,7 +11,7 @@ #include "Arduino.h" -#define MTP40F_LIB_VERSION (F("0.1.1")) +#define MTP40F_LIB_VERSION (F("0.1.2")) #define MTP40F_DEFAULT_ADDRESS 0x64 @@ -64,8 +64,9 @@ public: ////////////////////////////////////////////////////// - - +// +// PROTECTED +// protected: Stream * _ser; uint8_t _buffer[16]; diff --git a/libraries/MTP40F/README.md b/libraries/MTP40F/README.md index f1eadd44..7ab29a9f 100644 --- a/libraries/MTP40F/README.md +++ b/libraries/MTP40F/README.md @@ -1,9 +1,12 @@ [![Arduino CI](https://github.com/RobTillaart/MTP40F/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) -[![JSON check](https://github.com/RobTillaart/MTP40F/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/MTP40F/actions/workflows/jsoncheck.yml) [![Arduino-lint](https://github.com/RobTillaart/MTP40F/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/MTP40F/actions/workflows/arduino-lint.yml) +[![JSON check](https://github.com/RobTillaart/MTP40F/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/MTP40F/actions/workflows/jsoncheck.yml) +[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/MTP40F.svg)](https://github.com/RobTillaart/MTP40F/issues) + [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/MTP40F/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/RobTillaart/MTP40F.svg?maxAge=3600)](https://github.com/RobTillaart/MTP40F/releases) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/MTP40F.svg)](https://registry.platformio.org/libraries/robtillaart/MTP40F) # MTP40F @@ -45,7 +48,7 @@ commands e.g. **setSelfCalibration()**. The CRC of the sensor responses are not verified by the library (yet). -###s# Hardware interface MTP40-F +#### Hardware interface MTP40-F Has TTL level RS232, I2C and PWM IO. @@ -54,25 +57,25 @@ Has TTL level RS232, I2C and PWM IO. +-------------+ | | VCC (3v3 out) 5 --| |-- 1 Vin - TX 6 --| |-- 2 GND - RX 7 --| |-- 3 ALARM - R?T 8 --| |-- 4 PWM / I2C + TX / SDA 6 --| |-- 2 GND + RX / SCL 7 --| |-- 3 ALARM + R/T 8 --| |-- 4 PWM / I2C GND 9 --| | | | +-------------+ ``` -| Pin | Name | Description | -|:-----:|:----------|:-----------------------------| -| 1 | Vin | 4.2V - 5.5V | -| 2 | GND | idem | -| 3 | ALARM | HIGH above 1000 PPM, LOW below 800 PPM (hysteresis) | -| 4 | PWM/I2C | PWM out | -| 5 | VCC_O | 3V3 out for serial | -| 6 | TX | Transmit 9600 baud or SDA | -| 7 | RX | Receive 9600 baud or SCL | -| 8 | R/T | select I2C / Serial | -| 9 | GND | idem | +| Pin | Name | Description | +|:-----:|:-----------|:-----------------------------| +| 1 | Vin | 4.2V - 5.5V | +| 2 | GND | idem | +| 3 | ALARM | HIGH above 1000 PPM, LOW below 800 PPM (hysteresis) | +| 4 | PWM/I2C | PWM out | +| 5 | VCC_O | 3V3 out for serial | +| 6 | TX / SDA | Transmit 9600 baud or SDA | +| 7 | RX / SCL | Receive 9600 baud or SCL | +| 8 | R/T | select Serial or I2C | +| 9 | GND | idem | #### Links @@ -208,7 +211,6 @@ Note: read datasheet! datasheet states 0x2000 but that is 8192 which is rather strange. Assumption 2000 decimal is meant. - #### Could - serial bus with multiple devices? => diodes @@ -224,8 +226,16 @@ Note: read datasheet! - some functions returning bool should return int to handle errors better MTP40F_OK or ERROR flag. - #### Wont - store SPC point in the class? + +## Support + +If you appreciate my libraries, you can support the development and maintenance. +Improve the quality of the libraries by providing issues and Pull Requests, or +donate through PayPal or GitHub sponsors. + +Thank you, + diff --git a/libraries/MTP40F/examples/MTP40F_PWM_demo_test/MTP40F_PWM_demo_test.ino b/libraries/MTP40F/examples/MTP40F_PWM_demo_test/MTP40F_PWM_demo_test.ino index 93d7142b..3ad93c4a 100644 --- a/libraries/MTP40F/examples/MTP40F_PWM_demo_test/MTP40F_PWM_demo_test.ino +++ b/libraries/MTP40F/examples/MTP40F_PWM_demo_test/MTP40F_PWM_demo_test.ino @@ -7,7 +7,7 @@ // This sketch is meant to test the PWM conversion formula. // Written for an Arduino UNO. // - it first loops through all possible values. -// - then it generates a random pulselength (within range) on pin 7 +// - then it generates a random pulse length (within range) on pin 7 // - connect pin 7 to interrupt pin 3 as test. // // Connect the PWM output to the interrupt pin 2 or 3 of the UNO. diff --git a/libraries/MTP40F/library.json b/libraries/MTP40F/library.json index fba10797..fce0b2af 100644 --- a/libraries/MTP40F/library.json +++ b/libraries/MTP40F/library.json @@ -15,9 +15,9 @@ "type": "git", "url": "https://github.com/RobTillaart/MTP40F.git" }, - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", - "frameworks": "arduino", + "frameworks": "*", "platforms": "*", "headers": "MTP40F.h" } diff --git a/libraries/MTP40F/library.properties b/libraries/MTP40F/library.properties index 4a68395f..b8a4e2c3 100644 --- a/libraries/MTP40F/library.properties +++ b/libraries/MTP40F/library.properties @@ -1,5 +1,5 @@ name=MTP40F -version=0.1.1 +version=0.1.2 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for MTP40F CO2 sensor