Skip to content

Instantly share code, notes, and snippets.

@maxpromer
Last active April 8, 2024 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxpromer/f35bafa9023d5f09ae86dcc919159e90 to your computer and use it in GitHub Desktop.
Save maxpromer/f35bafa9023d5f09ae86dcc919159e90 to your computer and use it in GitHub Desktop.
#include <Wire.h>
#include <AHT10.h> // AHT10 Arduino library that can be downloaded from here https://github.com/enjoyneering/AHT10
AHT10Class AHT10;
void setup() {
Serial.begin(9600);
Wire.begin();
if (AHT10.begin(eAHT10Address_Low))
Serial.println("Init AHT10 Success!");
else
Serial.println("Init AHT10 Failed!");
}
void loop() {
Serial.println("//Arduino & AHT10//");
Serial.println("Quick Test – Serial Monitor");
Serial.println(String("") + "Humidity(%RH):\t\t" + AHT10.GetHumidity() + "%RH");
Serial.println(String("") + "Temperature(℃):\t" + AHT10.GetTemperature() + "℃");
Serial.println(String("") + "Dewpoint(℃):\t\t" + AHT10.GetDewPoint() + "℃");
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment