Arduino Code
For easy demonstration of our hardware, our team uses Arduino Mega 2560 broad to control the linear motion, robotic arm, sensors, LoRa chip, and fertilizer tank, so most of our code is written in Arduino IDE. The script below shows our Arduino code, and the detailed implementation will be explained in the comment.