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 code | |
/*the IDE of the arduino will not compile this code until you download the libraries mintioned in the code ,, the first library is "dht" library and the second is | |
"Servo" library .. if you use the code without downloading libraries , the IDE will show compiling errors*/ | |
#include <Servo.h> //the Servo library | |
#include "dht.h" //the humidty sensor library | |
const int trigPin = 8; // trig pin of ultrasonic | |
const int echoPin = 13; // echo pin of ultrasonic | |
long duration; // the time taken by ultrawaves from the emmiting side to the receving side | |
int distance; // the distance travelled by the ultrawaves | |
#define dht_apin A2 // the analog pin of the humidty sensor (because it depends on resistance) |