PaulS:
}void loop(){I sure hope that in time you won't write crap like this any more.
Haha funny guy. Fixed..
PaulS:
}void loop(){I sure hope that in time you won't write crap like this any more.
Haha funny guy. Fixed..
LinusRJ:
Here is my solution, for anyone interested.const int relay = 2;
const int wifiWire = 3;
int val;
boolean flag = false;
void setup(){
Serial.begin(9600);
pinMode(relay, OUTPUT);
pinMode(wifiWire, INPUT);
}
void loop(){
val = digitalRead(wifiWire);
if (val == LOW){
flag = false;
digitalWrite(relay, LOW);
}
if (val == HIGH){
if (!flag){
digitalWrite(relay, HIGH);
flag = true;
}
if (flag){
wifiInput();
}
}
}
Experience comes with time.. sorry for any confusion
What happens when your val goes low again? hmm?
const byte Relay = 2;
const byte WifiWire = 3;
bool flag = false;
void setup() {
Serial.begin(9600);
pinMode(Relay, OUTPUT);
digitalWrite(Relay, LOW);
pinMode(WifiWire, INPUT);
}
void loop() {
if (!flag) {
if (digitalRead(WifiWire) == HIGH) {
digitalWrite(Relay, HIGH);
flag = true;
}
}
else wifiInput();
}