LED output and file monitoring

As taken from random internet example code