Writing the Arduino sketch