My Untitled Site

There's nothing here yet (well, except for this message), but clicking on the "+" button in the menu above should change that. Have fun! :)

int led = 2;
int buzzer = 3;
int relay = 4;
int sensor = 5;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(relay, OUTPUT);
pinMode(sensor, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int value = digitalRead(sensor);
if(value == LOW)
{
digitalWrite(relay, HIGH);
digitalWrite(led, HIGH);
digitalWrite(buzzer, HIGH);
}else{
digitalWrite(relay, LOW);
digitalWrite(led, LOW);
digitalWrite(buzzer, LOW);
}
Serial.print("The sensor value is = ");
Serial.print(value);
}