4 input compare help
kind of new @ , i've run roadblock.
anybody have ideas on how check status of 4 digital inputs , if 3 of them have gone high, set flag bit?
basically i'm trying check 4 reed switches, , if 3 of them have been tripped set bit can use trigger rest of code in loop. (i want 3 out of 4 redundancy , fault tolerance.
i thinking checking pins, , adding 1 bit if result true, , doing each input, if total >3 setting flag, keep adding if 1 switch tripped.
or maybe large comparison statement?
any ideas?
thanks,
anybody have ideas on how check status of 4 digital inputs , if 3 of them have gone high, set flag bit?
basically i'm trying check 4 reed switches, , if 3 of them have been tripped set bit can use trigger rest of code in loop. (i want 3 out of 4 redundancy , fault tolerance.
i thinking checking pins, , adding 1 bit if result true, , doing each input, if total >3 setting flag, keep adding if 1 switch tripped.
or maybe large comparison statement?
any ideas?
thanks,
maybe try (in psuedo)
while((input1 + input2 + input3 + input4) < 3)
->do nothing
while((input1 + input2 + input3 + input4) < 3)
->do nothing
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > 4 input compare help
arduino
Comments
Post a Comment