Updated Arduino code

Updated code with changes recommended by Anthony VH via Hackaday and
blog post