modified to compile on the arduino due