Switch monitor Project


 hello,

i'm using adafruit metro mini 328 board.  i'm monitoring status of switch on truck , sending outputs device when switch has been turned on.

my issue truck has been giving false "on" , false "off".  think there interference on line i'm monitoring. when switch off must getting voltage spikes causing board think switch has been turned on, once goes away switches off.

i've added delay , state detection in , it's helped still doesn't seem solved problem. i'm hoping can check out code , make suggestions improve way i'm doing this.

find code attached. in advance @ all!

if put every { on line itself, used tools + auto format, , removed of useless white space, code far easier read.

you read switch many 3 times, , save "current" state last state. of 3 reads "current" state?


Arduino Forum > Using Arduino > Programming Questions > Switch monitor Project


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'