LED rendering code that may be useful to other projects