Simulating a PLC ladder diagram on arduino

Just thinking that this may have already been done in a way so a little googling came up with a few.

Here is one that looked OK.