New working version

- automatically check resolution
- blanking
- led switching
- proper exception handling