Let’s do it step by step:
1- first, since you modified the hardware you use, use circuito.io with your specific hardware set to get the exact schematic and sample code for your choice of hardware.
2- then use our sample code to verify your wiring and make sure all your hardware parts are doing the function they need to do.
After you’ve completed these and you know that on a basic level your hardware is working: producing sounds, measuring moisture… you can start building out the specific logic you need.
3 - try now to replace the code with the code snippet we provide in the tutorial and send us the error you’re getting (preferably a screenshot of your IDE)