Skip to content

Commit 357371e

Browse files
committed
0.3.3 AM232X
1 parent f23e46f commit 357371e

File tree

12 files changed

+50
-31
lines changed

12 files changed

+50
-31
lines changed

libraries/AM232X/.arduino-ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ compile:
22
# Choosing to run compilation tests on 2 different Arduino platforms
33
platforms:
44
- uno
5-
- leonardo
6-
- due
7-
- zero
5+
# - due
6+
# - zero
7+
# - leonardo
8+
- m4
9+
- esp32
10+
# - esp8266
11+
# - mega2560

libraries/AM232X/.github/workflows/arduino_test_runner.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ name: Arduino CI
44
on: [push, pull_request]
55

66
jobs:
7-
arduino_ci:
7+
runTest:
88
runs-on: ubuntu-latest
99

1010
steps:
1111
- uses: actions/checkout@v2
12-
- uses: Arduino-CI/action@master
13-
# Arduino-CI/[email protected]
14-
# Arduino-CI/action@master
12+
- uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: 2.6
15+
- run: |
16+
gem install arduino_ci
17+
arduino_ci.rb

libraries/AM232X/AM232X.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: AM232X.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.3.2
4+
// VERSION: 0.3.3
55
// PURPOSE: AM232X library for AM2320 for Arduino.
66
//
77
// HISTORY:
@@ -21,6 +21,7 @@
2121
// 0.3.0 2021-01-12 isConnected() + Wire0..Wire5 support
2222
// 0.3.1 2021-01-28 fix TODO's in code
2323
// 0.3.2 2021-03-30 #13 - timeout to isConnected() + wakeUp() + readme.md
24+
// 0.3.3 2021-10-19 update build-CI
2425

2526

2627
#include "AM232X.h"
@@ -259,7 +260,7 @@ int AM232X::_getData(uint8_t length)
259260
case 0x80: return AM232X_ERROR_FUNCTION;
260261
case 0x81: return AM232X_ERROR_ADDRESS;
261262
case 0x82: return AM232X_ERROR_REGISTER;
262-
case 0x83: return AM232X_ERROR_CRC_1; // prev write had a wrong CRC
263+
case 0x83: return AM232X_ERROR_CRC_1; // previous write had a wrong CRC
263264
case 0x84: return AM232X_ERROR_WRITE_DISABLED;
264265
default: return AM232X_ERROR_UNKNOWN;
265266
}

libraries/AM232X/AM232X.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// FILE: AM232X.h
44
// AUTHOR: Rob Tillaart
55
// PURPOSE: AM232X library for Arduino
6-
// VERSION: 0.3.2
6+
// VERSION: 0.3.3
77
// HISTORY: See AM232X.cpp
88
// URL: https://github.com/RobTillaart/AM232X
99
//
@@ -21,7 +21,7 @@
2121
#include "Wire.h"
2222

2323

24-
#define AM232X_LIB_VERSION (F("0.3.2"))
24+
#define AM232X_LIB_VERSION (F("0.3.3"))
2525

2626

2727

libraries/AM232X/README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11

22
[![Arduino CI](https://github.com/RobTillaart/AM232X/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
3+
[![Arduino-lint](https://github.com/RobTillaart/AM232X/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/AM232X/actions/workflows/arduino-lint.yml)
4+
[![JSON check](https://github.com/RobTillaart/AM232X/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/AM232X/actions/workflows/jsoncheck.yml)
35
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/AM232X/blob/master/LICENSE)
46
[![GitHub release](https://img.shields.io/github/release/RobTillaart/AM232X.svg?maxAge=3600)](https://github.com/RobTillaart/AM232X/releases)
57

8+
69
# AM232X
710

8-
Arduino library for AM2320 AM2321 and AM2322 I2C temperature and humidity sensor
11+
Arduino library for AM2320 AM2321 and AM2322 I2C temperature and humidity sensor.
912

1013

1114
## Description
@@ -19,11 +22,11 @@ See multiplexing below.
1922

2023
Typical parameters
2124

22-
| | range | accuracy | repeatability
23-
|:-------|:------:|:------:|:------:|
24-
| Temperature | -40 - 80 | 0.5°C | ±0.1 |
25-
| Humidity | 0.0 - 99.9 | 3% | ±0.1 |
26-
| Sample time | 2 seconds | | |
25+
| | range | accuracy | repeatability |
26+
|:------------|:----------:|:--------:|:-------------:|
27+
| Temperature | -40 - 80 | 0.5°C | ±0.1 |
28+
| Humidity | 0.0 - 99.9 | 3% | ±0.1 |
29+
| Sample time | 2 seconds | | |
2730

2831

2932
```
@@ -39,19 +42,22 @@ Typical parameters
3942

4043
## Interface
4144

45+
4246
### Constructor
4347

4448
- **AM232X(TwoWire \*wire = &Wire)** constructor, optionally set Wire0..WireN.
45-
- **bool begin(uint8_t sda, uint8_t scl)** for ESP32 alike devices, returns true if device is connected
46-
- **bool begin()** for AVR alike devices, returns true if device is connected
47-
- **bool isConnected(uint16_t timeout = 3000)** returns true if device-address is found on I2C bus. As the device can be in sleep modus it will retry for the defined timeout (in micros) with a minimum of 1 try. minimum = 800 us and maximum = 3000 us according to datasheet.
49+
- **bool begin(uint8_t sda, uint8_t scl)** for ESP32 alike devices, returns true if device is connected.
50+
- **bool begin()** for AVR alike devices, returns true if device is connected.
51+
- **bool isConnected(uint16_t timeout = 3000)** returns true if device-address is found on I2C bus.
52+
As the device can be in sleep modus it will retry for the defined timeout (in micros) with a minimum of 1 try.
53+
minimum = 800 us and maximum = 3000 us according to datasheet.
4854

4955

5056
### Base calls
5157

52-
- **int read()** fetches the values from the sensor
53-
- **float getHumidity()** returns the last read humidity
54-
- **float getTemperature()** returns the last read temperature
58+
- **int read()** fetches the values from the sensor.
59+
- **float getHumidity()** returns the last read humidity.
60+
- **float getTemperature()** returns the last read temperature.
5561

5662

5763
### Misc
@@ -75,8 +81,7 @@ check datasheet for details.
7581
See examples
7682

7783
In setup() you have to call the **begin()** to initialize
78-
the Wire library and do an initial **read()** to fill the
79-
variables temperature and humidity.
84+
the Wire library and do an initial **read()** to fill the variables temperature and humidity.
8085
To access these values one must use **getTemperature()** and **getHumidity()**.
8186

8287
Note that the sensor can go into sleep mode and one might need to call **wakeUp()**
@@ -100,9 +105,10 @@ have the "boot time" constraint mentioned above.
100105
Which method fit your application depends on your requirements and constraints.
101106

102107

103-
104108
## Future
105109

110+
- update documentation
111+
- test more
106112

107113

108114
## Warning

libraries/AM232X/examples/AM2320/AM2320.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@ void loop()
6666
delay(2000);
6767
}
6868

69+
6970
// -- END OF FILE --

libraries/AM232X/examples/AM2320_test/AM2320_test.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ void loop()
9696
{
9797
}
9898

99+
99100
// -- END OF FILE --

libraries/AM232X/examples/AM2322_plotter/AM2322_plotter.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// PURPOSE: demo sketch for AM2322 I2C humidity & temperature sensor
66
//
77
// HISTORY:
8-
// 0.1.0 2020-09-01 simple program to dump for plotter.
8+
// 0.1.0 2020-09-01 simple program to dump for plotter.
99
// 0.1.1 2021-01-28 added begin() ++
1010

1111
//

libraries/AM232X/keywords.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Syntax Coloring Map For DHT_I2C
1+
# Syntax Colouring Map For DHT_I2C
22

33

4-
# Datatypes (KEYWORD1)
4+
# Data types (KEYWORD1)
55
AM232X KEYWORD1
66

77

libraries/AM232X/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/AM232X"
1717
},
18-
"version": "0.3.2",
18+
"version": "0.3.3",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*"

0 commit comments

Comments
 (0)