Fix digital read, add a bunch of debug output that should be deleted