Update the code to run on the Arduino Mega