Add code to open and close the arduino fd.