WORKING WITH PIR MOTION SENSOR DETECTS HIGH ALL THE TIME PROJECT DUE TONIGHT

int LEDPIN=4; int SENSORPIN=2; int Detected= LOW;

void setup() { pinMode(LEDPIN, OUTPUT); // declare LED as output pinMode(SENSORPIN, INPUT); // declare the PIR sensor as input Serial.begin(9600); //Set serial out if we want debugging } void loop(){

Detected= digitalRead(SENSORPIN);

if(Detected = HIGH){

digitalWrite(LEDPIN, HIGH);

}

} ///// PLEASE HELP ME WHATS WRONG WITH MY CODE///

  if(Detected = HIGH){

= for assignment, == for comparison.

If else reference

If the motion sensor goes low there is nothing to turn the LED off.