Trouble adapting Speed code (Reed Switch)

Which has a radius of 0.87 Inches instead of 13.5 used below.

So, you took this code that works, made some changes that didn't work, and you want us to guess what changes you made, and where you screwed up. No, it doesn't work that way.