0.1.2 tinySHT2x

This commit is contained in:
rob tillaart 2022-11-26 14:30:01 +01:00
parent 207321dc01
commit 3e86f2a8ad
7 changed files with 60 additions and 9 deletions

View File

@ -1,3 +1,18 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:
packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
@ -10,3 +25,4 @@ compile:
# - esp8266
- mega2560
# - trinket
- rpipico

View File

@ -0,0 +1,25 @@
# Change Log tinySHT2x
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.2] - 2022-11-26
- Add RP2040 support to build-CI.
- Add CHANGELOG.md
- update readme.md
- minor edits
- update unit test
## [0.1.1] - 2021-12-29
- update library.json
- update readme.md
- update license
- minor edits
## [0.1.0] - 2021-09-27
- initial version

View File

@ -26,8 +26,16 @@ Based upon https://github.com/RobTillaart/SHT2x
## Future
#### must
- test test test test (Viktor)
- improve documentation
#### should
#### could
- Can a tiny have another Wire than Wire?
- Check the status bit (temperature / humidity flag)
- datasheet page 8, LSB bit 1 - bit 0 not used)
- needed?

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/tinySHT2x.git"
},
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",

View File

@ -1,5 +1,5 @@
name=tinySHT2x
version=0.1.1
version=0.1.2
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for the SHT20, SHT21 and SHT25 temperature and humidity sensor. Optimized for AVR tiny.

View File

@ -47,6 +47,12 @@ unittest_teardown()
}
unittest(test_constant)
{
assertEqual(-999, TINY_SHT2x_NO_VALUE);
}
unittest(test_constructor)
{
tinySHT2x sht;

View File

@ -1,15 +1,11 @@
//
// FILE: tinytinySHT2x.cpp
// AUTHOR: Rob Tillaart, Viktor Balint
// VERSION: 0.1.1
// VERSION: 0.1.2
// DATE: 2021-09-27
// PURPOSE: Arduino library for the SHT2x temperature and humidity sensor optimized for AVR tiny
// URL: https://github.com/RobTillaart/tinytinySHT2x
//
// HISTORY:
// 0.1.0 2021-09-27 initial version
// 0.1.1 2021-12-29 update library.json, readme, license, minor edits
#include "tinySHT2x.h"
@ -61,7 +57,7 @@ float tinySHT2x::getHumidity()
delay(30);
if (readBytes(3, (uint8_t*) &buffer[0], 30) == false)
{
return -999;
return TINY_SHT2x_NO_VALUE;
}
raw = buffer[0] << 8;
raw += buffer[1];
@ -111,5 +107,5 @@ bool tinySHT2x::readBytes(uint8_t n, uint8_t *val, uint8_t maxDuration)
}
// -- END OF FILE --
// -- END OF FILE --