Created
December 31, 2014 02:11
-
-
Save not-for-me/1c74a3371f9a5fba5ec7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Arduino Sample Code for SHT1x Humidity and Temperature Sensor | |
//www.DFRobot.com | |
//Version 1.0 | |
#include <SHT1x.h> | |
// Specify data and clock connections and instantiate SHT1x object | |
#define dataPin 10 | |
#define clockPin 11 | |
SHT1x sht1x(dataPin, clockPin); | |
void setup() | |
{ | |
Serial.begin(9600); // Open serial connection to report values to host | |
} | |
void loop() | |
{ | |
float temp_c; | |
float humidity; | |
// Read values from the sensor | |
temp_c = sht1x.readTemperatureC(); | |
humidity = sht1x.readHumidity(); | |
// Print the values to the serial port | |
Serial.print("Temperature: "); | |
Serial.print(temp_c, DEC); | |
Serial.print("C "); | |
Serial.print("Humidity: "); | |
Serial.print(humidity); | |
Serial.println("%"); | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment