created function and button to copy arduino code to a file