EasyManua.ls Logo

Eckstein komponente KS0530 - Page 123

Default Icon
160 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
123
lesson 7.1
DHT11
http://www.keyestudio.com
*/
#include <dht11.h> //include the library code:
dht11 DHT;
#define DHT11_PIN 7 //define the DHT11 as the digital port 7
void setup() {
Serial.begin(9600);
}
void loop() {
int chk;
chk = DHT.read(DHT11_PIN); // read data
switch (chk) {
case DHTLIB_OK:
break;
case DHTLIB_ERROR_CHECKSUM: //check and return errors
break;
case DHTLIB_ERROR_TIMEOUT: //timeout and return errors
break;
default: