Quote Originally Posted by mbw123
One last thing. Will the code (your most recent post before this one) work when two or more buttons are pressed at the same time? Thank you for the help.

-Mike
Hi Mike, multiple keypresses shouldnt be a problem as it takes the value of all switches as a 4 bit binary value eg 0110 and sends that to the distant end where you write 1001 (or 0110 if you dont invert) to the output port.

LASTPORT gets set as 0110 ( or 6 if you prefer) and the next time it looks at the port if the value is any different the new value will be sent and stored.

It doesnt matter whether it has changed to 0100, 0111, 1010 etc because all of them are different to 0110 and the entire port value will be replicated at the distand end with just a single command string.