Code for LED driver

Converted to non-Object-Oriented code.