Automated Gardening Project

Recently, I have been working on a automated gardening/data logging project. I am using a 12 volt pump and relay connected to a arduino mega to water the garden. To log data, I have 3 moisture sensors, a dht11, a photoresistor, a rtc module (DS3231), and an sd card shield. I also have one through hole status neopixel. I would like my arduino to log data to the sd card every hour and turn on the relay for the pump when the average soil reading is above the threshold I have set. My neopixel displays a color based on what task the arduino is performing. I have just recently gotten back into using my arduino and programming. Will my code work as planned? Any suggestions?

Garduino_Datalogger.ino (6.61 KB)

Whoops! I have attached the code.

I thought copy and pasting might be slightly easier. Would you suggest accepting an int (1,2, or 3) as a parameter and using a switch case to determine the sensor or is there a way I could pass the variable names used in each function directly as parameters.

diyguy3030:
Will my code work as planned? Any suggestions?

Did you simply try it all out already?