Skip to content

Instantly share code, notes, and snippets.

View Ahmed-Yasser-Ahmed's full-sized avatar

Ahmed-Yasser-Ahmed

View GitHub Profile
@Ahmed-Yasser-Ahmed
Ahmed-Yasser-Ahmed / NASA Space Apps Project
Last active October 28, 2018 20:50
NASA Space Apps Project
//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)