Arduino first timer!! Why don`t this program work

String Innkommende;
int Skallsikring1 = 1;
int Skallsikring2 = 2;
int Skallsikring3 = 3;
int UtgangAlarm = 13;
void setup() {
Serial.begin(9600);
pinMode(Skallsikring1, INPUT);
pinMode(Skallsikring2, INPUT);
pinMode(Skallsikring3, INPUT);
pinMode(UtgangAlarm, OUTPUT);
}

void loop() {
if (Serial.available()) {
if ((Skallsikring1 != LOW) || (Skallsikring2 != LOW)|| (Skallsikring3 != LOW) == HIGH){
digitalWrite(UtgangAlarm, HIGH);
Serial.print("Situasjon:");
Serial.println(7); //Whatever input status - program will always go this way???

} else {
digitalWrite(UtgangAlarm, LOW);
Serial.print("Situasjon:");
Serial.println(6);
}

delay(1000);
}

}

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you're using the Arduino Web Editor you will not have access to this useful tool but it's still unacceptable to post poorly formatted code. I recommend you to use the standard IDE instead.

Please remove unnecessary blank lines from your code before posting to the forum. One or two to separate code into logical sections is fine but large spaces for no reason or random blank lines just make for more scrolling when we're trying to read your code.

I'm guessing this is your problem:

(Skallsikring3 != LOW) == HIGH

Thank you for your help.

This is my first attempt at programming of Arduino. Also my first posting on this forum. Sorry for missing information in my frustrating question.

The software are ment to have three inputs and one output. If one of the inputs are active it shall activate the output.

When the output is HIGH then send a serial print
When the output is LOW then send a serial print

Thanks.

You gave me progress with that by the way!. Now the output is not always HIGH any more, but not possible to get HIGH.

I have used many hours (do not dear to tell how many) trying to get a grip of this programming metod. This is totally new for me.

Hope that this are posted correctly?

I am very grateful for your help.

  String Innkommende;
  int Skallsikring1 = 2;
  int Skallsikring2 = 3;
  int Skallsikring3 = 4;
  int UtgangAlarm = 13;
  void setup() {
      Serial.begin(9600);
      pinMode(Skallsikring1, INPUT);
      pinMode(Skallsikring2, INPUT);
      pinMode(Skallsikring3, INPUT);
      pinMode(UtgangAlarm, OUTPUT);
  }

  void loop() {
      if (Serial.available()) {
            if ((Skallsikring1 == HIGH) || (Skallsikring2 == HIGH)|| (Skallsikring3 == HIGH) == HIGH){
              digitalWrite(UtgangAlarm, HIGH);
                Serial.print("Situasjon:");
                Serial.println(7); 
          } else {
              digitalWrite(UtgangAlarm, LOW);
                Serial.print("Situasjon:");
                Serial.println(6);
          }

          
           
          delay(1000);
      }


  }
  int Skallsikring1 = 2;
  
            if ((Skallsikring1 == HIGH)

If I tell you that HIGH has the value 1, how likely do you think it is that that "if" expression will ever be true?

I would like to see how it’s wired up and if your using something that requires a pull up or a pull down resistor.

You have inputs but they may not be wired correctly or you need to use input pull-up in addition to code corrections.

Also get rid of Serial available. What do you need it for?

The reason your having an issue is because you have to monitor the state change of your inputs.

You may keep your first set of ints as they were originally but you must use a state variable and tell that to be the read of your PIN number whether the pin is 1 or 2 or whatever.

Then when you write the of statement use the state variable as your high and low. NOT THE PIN INT.

  int Skallsikring1 = 2;
  int Skallsikring2 = 3;
  int Skallsikring3 = 4;
  int UtgangAlarm = 13;
  void setup() {
      Serial.begin(9600);
      pinMode(Skallsikring1, INPUT);
      pinMode(Skallsikring2, INPUT);

So SkallsikringX are Arduino pin numbers?

      if (Serial.available()) {
            if ((Skallsikring1 == HIGH) || (Skallsikring2 == HIGH)|| (Skallsikring3 == HIGH) == HIGH){
              digitalWrite(UtgangAlarm, HIGH);

[/code]

But here, you are accessing only the pin numbers; to test the values of the pins themselves, you need to access them via the digitalRead() function:

           if ((digitalRead(Skallsikring1) == HIGH) || (digitalRead(Skallsikring2) == HIGH) ...

Also, you check Serial.available(), but never actually read the data, so once you've sent data, Serial.available() will be true forever...

Thanks for all help.

Finally the program works as it should.