How to save data in a buffer in Arduino