initial upload
This commit is contained in:
parent
ba9d4ed578
commit
c493bc6618
28 changed files with 3146 additions and 0 deletions
|
@ -0,0 +1,36 @@
|
|||
/***************************************************
|
||||
This is an example for the HTU21D-F Humidity & Temp Sensor
|
||||
|
||||
Designed specifically to work with the HTU21D-F sensor from Adafruit
|
||||
----> https://www.adafruit.com/products/1899
|
||||
|
||||
These displays use I2C to communicate, 2 pins are required to
|
||||
interface
|
||||
****************************************************/
|
||||
|
||||
#include <Wire.h>
|
||||
#include "Adafruit_HTU21DF.h"
|
||||
|
||||
// Connect Vin to 3-5VDC
|
||||
// Connect GND to ground
|
||||
// Connect SCL to I2C clock pin (A5 on UNO)
|
||||
// Connect SDA to I2C data pin (A4 on UNO)
|
||||
|
||||
Adafruit_HTU21DF htu = Adafruit_HTU21DF();
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Serial.println("HTU21D-F test");
|
||||
|
||||
if (!htu.begin()) {
|
||||
Serial.println("Couldn't find sensor!");
|
||||
while (1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
Serial.print("Temp: "); Serial.print(htu.readTemperature());
|
||||
Serial.print("\t\tHum: "); Serial.println(htu.readHumidity());
|
||||
delay(500);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue