Skip to content

Commit

Permalink
update library.json, license, minor edits (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Dec 28, 2021
1 parent 08034a9 commit 5e5ede3
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 30 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-2021 Rob Tillaart
Copyright (c) 2021-2022 Rob Tillaart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ The SHT2x family of sensors should work up to 400 KHz I2C.

Furthermore there are a number of compatible sensors, these are not tested either.


| Sensor | Temperature accuracy | Humidity accuracy |
|:-------:|:--------------------:|:-----------------:|
| SHT20 | ~0.3 | ±3.0 |
| SHT21 | ~0.3 | ±3.0 |
| SHT25 | ~0.3 | ±1.8 |
| HTU20 | | | to-do
| HTU21 | | | to-do
| Si7013 | | | to-do
| Si7020 | | | to-do
| Si7021 | | | to-do
Accuracy table

| Sensor | Temperature | Humidity | Notes |
|:-------:|:-----------:|:--------:|:-------|
| SHT20 | ~0.3 | ±3.0 | |
| SHT21 | ~0.3 | ±3.0 | |
| SHT25 | ~0.3 | ±1.8 | |
| HTU20 | | | to-do |
| HTU21 | | | to-do |
| Si7013 | | | to-do |
| Si7020 | | | to-do |
| Si7021 | | | to-do |


All sensors in this family of sensors have address 0x40 (64 decimal).
Expand Down
4 changes: 2 additions & 2 deletions SHT2x.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: SHT2x.cpp
// AUTHOR: Rob Tillaart, Viktor Balint
// VERSION: 0.1.2
// VERSION: 0.1.3
// DATE: 2021-09-25
// PURPOSE: Arduino library for the SHT2x temperature and humidity sensor
// URL: https://github.com/RobTillaart/SHT2x
Expand All @@ -14,7 +14,7 @@
// 0.1.2 2021-09-29 Add Si70xx derived classes
// add getEIDA(), getEIDB(), getFirmwareVersion()
// update build-CI, readme.md badges
//
// 0.1.3 2021-12-28 update library.json, license, minor edits


#include "SHT2x.h"
Expand Down
4 changes: 2 additions & 2 deletions SHT2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// FILE: SHT2x.h
// AUTHOR: Rob Tillaart, Viktor Balint
// VERSION: 0.1.2
// VERSION: 0.1.3
// DATE: 2021-09-25
// PURPOSE: Arduino library for the SHT2x temperature and humidity sensor
// URL: https://github.com/RobTillaart/SHT2x
Expand All @@ -13,7 +13,7 @@
#include "Wire.h"


#define SHT2x_LIB_VERSION (F("0.1.2"))
#define SHT2x_LIB_VERSION (F("0.1.3"))


// fields getStatus
Expand Down
1 change: 0 additions & 1 deletion examples/SHT2x_EID_firmware/SHT2x_EID_firmware.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_EID.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/SHT2x

Expand Down
2 changes: 1 addition & 1 deletion examples/SHT2x_I2Cspeed/SHT2x_I2Cspeed.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_I2Cspeed
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: testing the performance at different I2C speeds
// URL: https://github.com/RobTillaart/SHT2x

Expand Down Expand Up @@ -57,3 +56,4 @@ void test()


// -- END OF FILE --

1 change: 0 additions & 1 deletion examples/SHT2x_demo/SHT2x_demo.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_demo.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/SHT2x

Expand Down
1 change: 0 additions & 1 deletion examples/SHT2x_heater/SHT2x_heater.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_heater.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo heater functions
// URL: https://github.com/RobTillaart/SHT2x

Expand Down
1 change: 0 additions & 1 deletion examples/SHT2x_heaterLevel/SHT2x_heaterLevel.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_heaterLevel.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo heaterLevel functions
// URL: https://github.com/RobTillaart/SHT2x

Expand Down
1 change: 0 additions & 1 deletion examples/SHT2x_isConnected/SHT2x_isConnected.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_isConnected.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/SHT2x

Expand Down
1 change: 0 additions & 1 deletion examples/SHT2x_lastRead/SHT2x_lastRead.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_lastRead.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/SHT2x

Expand Down
2 changes: 1 addition & 1 deletion examples/SHT2x_nolib/SHT2x_nolib.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_nolib.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: test sensor without library
// URL: https://github.com/RobTillaart/SHT2x

Expand Down Expand Up @@ -121,3 +120,4 @@ float getHumidity()


// -- END OF FILE --

1 change: 0 additions & 1 deletion examples/SHT2x_rawValues/SHT2x_rawValues.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: SHT2x_raw_values.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo raw
// URL: https://github.com/RobTillaart/SHT2x

Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SHT2x",
"keywords": "SHT20 SHT21 SHT25 HTU20D HTU21D",
"keywords": "SHT20,SHT21,SHT25,HTU20D,HTU21D",
"description": "Arduino library for the I2C SHT20 SHT21 SHT25 series temperature and humidity sensor. Works also for HTU2xD(F) series.",
"authors":
[
Expand All @@ -18,7 +18,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/SHT2x.git"
},
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SHT2x
version=0.1.2
version=0.1.3
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for the I2C SHT20 SHT21 SHT25 series temperature and humidity sensor.
Expand Down
29 changes: 27 additions & 2 deletions test/unit_test_001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ uint32_t start, stop;

unittest_setup()
{
fprintf(stderr, "SHT2x_LIB_VERSION: %s \n", (char *) SHT2x_LIB_VERSION);
}


Expand All @@ -49,9 +50,34 @@ unittest_teardown()
}


unittest(test_constants_1)
{
fprintf(stderr, "fields getStatus\n");
assertEqual(SHT2x_STATUS_OPEN_CIRCUIT , 0x00);
assertEqual(SHT2x_STATUS_TEMPERATURE , 0x01);
assertEqual(SHT2x_STATUS_HUMIDITY , 0x02);
assertEqual(SHT2x_STATUS_CLOSED_CIRCUIT, 0x03);
}


unittest(test_constants_2)
{
fprintf(stderr, "error codes\n");
assertEqual(SHT2x_OK , 0x00);
assertEqual(SHT2x_ERR_WRITECMD , 0x81);
assertEqual(SHT2x_ERR_READBYTES , 0x82);
assertEqual(SHT2x_ERR_HEATER_OFF , 0x83);
assertEqual(SHT2x_ERR_NOT_CONNECT , 0x84);
assertEqual(SHT2x_ERR_CRC_TEMP , 0x85);
assertEqual(SHT2x_ERR_CRC_HUM , 0x86);
assertEqual(SHT2x_ERR_CRC_STATUS , 0x87);
assertEqual(SHT2x_ERR_HEATER_COOLDOWN, 0x88);
assertEqual(SHT2x_ERR_HEATER_ON , 0x89);
}


unittest(test_constructor)
{
fprintf(stderr, "SHT2x_LIB_VERSION: %s \n", (char *) SHT2x_LIB_VERSION);
SHT2x sht;

bool b = sht.begin();
Expand Down Expand Up @@ -148,7 +174,6 @@ unittest(test_heater)
}



unittest_main()

// --------

0 comments on commit 5e5ede3

Please sign in to comment.