Skip to content

Commit d343dd4

Browse files
committedApr 17, 2020
Final touches on version 1.0.0
Moved library source files, added library.properties and keywords.txt
1 parent 4235ce1 commit d343dd4

File tree

5 files changed

+47
-7
lines changed

5 files changed

+47
-7
lines changed
 

‎examples/Example1_GetMeasurements/Example1_GetMeasurements.ino

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Original Creation Date: March 31, 2020
77
88
SparkFun labored with love to create this code. Feel like supporting open
9-
source hardware? Buy a board from SparkFun! LINK GOES HERE
9+
source hardware? Buy a board from SparkFun! https://www.sparkfun.com/products/16618
1010
1111
This code is lemonadeware; if you see me (or any other SparkFun employee)
1212
at the local, and you've found our code helpful, please buy us a round!
@@ -19,7 +19,7 @@
1919
**************************************************************************/
2020
#include <Wire.h>
2121

22-
#include <SparkFun_Qwiic_Humidity_AHT20.h> //Click here to get the library: LINK GOES HERE
22+
#include <SparkFun_Qwiic_Humidity_AHT20.h> //Click here to get the library: http://librarymanager/All#Qwiic_Humidity_AHT20 by SparkFun
2323
AHT20 humiditySensor;
2424

2525
void setup()
@@ -33,19 +33,21 @@ void setup()
3333
if (humiditySensor.begin() == false)
3434
{
3535
Serial.println("AHT20 not detected. Please check wiring. Freezing.");
36-
while (1)
37-
;
36+
while (1);
3837
}
3938
Serial.println("AHT20 acknowledged.");
4039
}
4140

4241
void loop()
4342
{
43+
//If a new measurement is available
4444
if (humiditySensor.available() == true)
4545
{
46+
//Get the new temperature and humidity value
4647
float temperature = humiditySensor.getTemperature();
4748
float humidity = humiditySensor.getHumidity();
4849

50+
//Print the results
4951
Serial.print("Temperature: ");
5052
Serial.print(temperature, 2);
5153
Serial.print(" C\t");
@@ -59,4 +61,4 @@ void loop()
5961
//The AHT20 can respond with a reading every ~50ms. However, increased read time can cause the IC to heat around 1.0C above ambient.
6062
//The datasheet recommends reading every 2 seconds.
6163
delay(2000);
62-
}
64+
}

‎keywords.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
==================================
2+
CLASS
3+
==================================
4+
AHT20 KEYWORD1
5+
6+
==================================
7+
FUNCTIONS
8+
==================================
9+
begin KEYWORD2
10+
isConnected KEYWORD2
11+
available KEYWORD2
12+
getStatus KEYWORD2
13+
isCalibrated KEYWORD2
14+
isBusy KEYWORD2
15+
initialize KEYWORD2
16+
triggerMEasurement KEYWORD2
17+
readData KEYWORD2
18+
softReset KEYWORD2
19+
getTemperature KEYWORD2
20+
getHumidity KEYWORD2
21+
22+
==================================
23+
CONSTANTS
24+
==================================
25+
DEFAULT_ADDRESS LITERAL1
26+
27+
==================================
28+
DATA TYPES
29+
==================================

‎library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=SparkFun Qwiic Humidity AHT20
2+
version=v1.0.0
3+
author=SparkFun Electronics
4+
maintainer=SparkFun Electronics
5+
sentence=A library to drive ASAIT's new AHT20 temperature and humidity IC.
6+
paragraph=Use our solderless and easy-to-use Qwiic system to send I2C commands to the <a href="https://www.sparkfun.com/products/16618">SparkX Qwiic Humiditiy AHT20</a> to get current temperature and humidity readings.
7+
category=Sensors
8+
url=https://github.com/sparkfun/SparkFun_Qwiic_Humidity_AHT20_Arduino_Library
9+
architectures=*

‎SparkFun_Qwiic_Humidity_AHT20.cpp renamed to ‎src/SparkFun_Qwiic_Humidity_AHT20.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Original Creation Date: March 25, 2020
66
* https://github.com/sparkfun/SparkFun_Qwiic_Humidity_AHT20_Arduino_Library
77
*
8-
* Pick up a board here: LINK GOES HERE
8+
* Pick up a board here: https://www.sparkfun.com/products/16618
99
*
1010
* This file implements all the functions of the AHT20 class.
1111
* Functions in this library can return the humidity and temperature

‎SparkFun_Qwiic_Humidity_AHT20.h renamed to ‎src/SparkFun_Qwiic_Humidity_AHT20.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Original Creation Date: March 25, 2020
66
* https://github.com/sparkfun/SparkFun_Qwiic_Humidity_AHT20_Arduino_Library
77
*
8-
* Pickup a board here: LINK GOES HERE
8+
* Pickup a board here: https://wwww.sparkfun.com/products/16618
99
*
1010
* This file prototypes the AHT20 class implemented in SparkFun_Qwiic_Humidity_AHT20.cpp
1111
*

0 commit comments

Comments
 (0)
Please sign in to comment.