Added Diagnostic display mode, removed Ardunio ifdefs, cleaned up dutycycle[] access, shortened getnextbit()