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,

maybe try (in psuedo)

while((input1 + input2 + input3 + input4) < 3)
                        ->do nothing


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > 4 input compare help


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums