EM shutter almost working. Still a few things needed...

I've been ripping my hair out trying to figure out how to adapt any of this to make the loop run.