Why won't the slide switches control the motor in this 123d simulation? int guard = 7;
int switchPin = 6;
int motorPin = 9;

void setup(){
  pinMode(guard,INPUT);
  pinMode(switchPin,INPUT);
  pinMode(motorPin,OUTPUT);
}

  void loop(){
   if (digitalRead(guard==HIGH)&amp;&amp;digitalRead(switchPin==HIGH))              //&amp;&amp;

   {

     digitalWrite(motorPin,HIGH);
    delay(500);
    digitalWrite(motorPin,LOW);
    delay(1000);
   }
        else {

     digitalWrite(motorPin,LOW);
   }

  }
This should be written like this:

if ( digitalRead(guard)==HIGH &amp;&amp; digitalRead(switchPin)==HIGH ) {

// Rest of the code..

}