Arduino: update the sketch for more reliable use and clarity