New and trying to figure out code

the 3 second delay was for writing the data to the SD card.