Hi Anyone,
Now I am doing the Final Year project of Automatic Greenhouse Control System. Can please advise how to combine the 3 different CODEs into one programme file for uploading into Arduino UNO R3 microcontroller?
below are the codes;
Motion sensor CODE:
const byte ledPin = A1; // LED pin
const byte lightSensorPin = 13; // lightSensor input pin
byte senseMotion = 0; // variable to hold current state of motion detector
void setup() {
// set the digital pin directions
pinMode(ledPin, OUTPUT);
pinMode(lightSensorPin, INPUT);
}
void loop()
{
// Now watch for daylight
senseMotion = digitalRead(lightSensorPin);
if (senseMotion == HIGH) { // insufficient daylight, yet...
digitalWrite(ledPin, LOW);
} else { // sufficient daylight!
digitalWrite(ledPin, HIGH);
}
delay(1000);
}
DHT 11 sensor with LCD CODE;
#include <dht.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
dht DHT;
#define DHT11_PIN 7
void setup(){
lcd.begin(16, 2);
}
void loop()
{
int chk = DHT.read11(DHT11_PIN);
lcd.setCursor(0,0);
lcd.print("Temp = ");
lcd.print(DHT.temperature);
lcd.setCursor(0,1);
lcd.print("Humidity = ");
lcd.print(DHT.humidity);
delay(1000);
}
thank you.
Min