How to stop and save data on arduino board