I would implement it as a Finite State Machine (FSM) where the state is whatever the output is, then change state or not depending on the bit pulled in. Something like -
Code:
OutputLow: set pin, 0 receive bit if bit == 1 then jmp OutputHigh jmp OutputLowOutputHigh: set pin, 1 receive bit if bit == 1 then jmp OutputLow jmp OutputHighStatistics: Posted by hippy — Wed Mar 12, 2025 2:48 pm