I know you get the idea already, but I thought it would be fun to illustrate it in a drawing ![]()

I think this is the simplest solution and only requires the hardware you already have. Just reconfigured a little bit and some logic changes in the software.