Programming an automated fire extinguisher.

Sure, here it is. :slight_smile:

Heres is the programming i just did, what am i doing wrong if anything?

 const int buttonPin = 2;     // smokedetector 1
 const int buttonPin2 = 3;    // smokedetector 2
 const int ledPin =  10;      // relay1
 const int ledPin2 =  11;     // relay2

// variables will change:
int buttonState = 0;       

void setup() {
   // initialize relay 1 pin as an output:
   pinMode(ledPin, OUTPUT);      
   // initialize relay 2 pin as an output:
   pinMode(ledPin2, OUTPUT);    
   // initialize the smokedetector 1 pin as an input:
   pinMode(buttonPin, INPUT);     
   // initialize the smokedetector 2 pin as an input:
   pinMode(buttonPin2, INPUT);     
}

void loop(){
   // read the state of the pushbutton value:
   buttonState = digitalRead(buttonPin);
   buttonState = digitalRead(buttonPin2);

   // check if the pushbutton is pressed.
   // if it is, the buttonState is HIGH:
   if (buttonState == HIGH) {     
     // turn LED on:    
     digitalWrite(ledPin, HIGH);  
     digitalWrite(ledPin2, HIGH);  
   } 
   else {
     // turn relays off:
     digitalWrite(ledPin, LOW); 
     digitalWrite(ledPin2, LOW); 
   }
}