added logging to arduino specific code