'Pin4=0 means there is pressure on switch leg4 'Pin3=1 means there is pressure on switch leg2 'high 0 means LED ON 'low 1 means pump allowed 'pin2=1 means pump is running (sense) main: low 1 'pump allowed low 0 'LED off if pin4=0 or pin3=1 then switchfail setint %00000100,%00000100 high 0 pause 200 low 0 wait 4 goto main interrupt: if pin2=1 then pressurecheck 'pump is on pressurecheck: high 0 'LED on wait 10 'allow time for pump to build up pressure normal: if pin2=0 then pumpcheck 'pump is off if pin4=0 and pin3=0 then switchfail if pin4=1 and pin3=1 then switchfail if pin4=1 and pin3=0 then pumpcheck 'check on switch & pump pressure while pump running goto normal 'loop here until input change pumpcheck: wait 5 if pin2=1 then pressurefail return pressurefail: high 1 'stop pump wait 1 low 0 'slow flash LED wait 1 high 0 goto pressurefail 'requires manual reset switchfail: pause 200 high 1 'stop pump low 0 'fast flash LED pause 200 high 0 goto switchfail 'requires manual reset