Working code with SD shield and datalogging