In the video when you're talking about your global variables you mention that you don't remember whether you're using error any more. Something I find really useful is to make all the globals that are only used in my sketch static. After doing that when you turn on compiler warnings in File > Preferences you will get a warning message for any global that is not used. So if you change line 51 to:
static byte error;
you get the warning:
C:\Users\per\AppData\Local\Temp\arduino_modified_sketch_443145\Sled020.ino:51:13: warning: 'error' defined but not used [-Wunused-variable]
static byte error;