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???
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 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.