Hello,
First of all, it's perfectly ok for you to self source. That's why we made the project open source. No apologies necessary. Assuming you get the project working and enjoy it, we'd appreciate you spreading the word in lieu of payment... a youtube video post with our URL in the description, a FB post with a picture of your project, an instagram post, tiktok, whatever else, etc.
Now, on to your issue. You did the right thing by first confirming that the hardware setup is good. But it seems like the modes are not triggering as expected.
You could uncomment the line of code in loop that says this:
//Serial.print("Analog0="); Serial.println(p);
A search in the IDE for Analog0 will find it. Recompile.
However, that's not quite enough. From what you're saying, it almost sounds like you're never making it out of setup(). There are numerous reasons why this might happen.
One would be a bad buzzer. I've seen it happen that a defective buzzer will basically draw so much power that it browns out the nano. You never mentioned whether you hear any beeps coming out of the robot. If you do, please report what you hear.
You could just unplug the buzzer and see if things start to work.
If that doesn't do the trick, we need to know exactly where in setup() the issue is happening. The only easy way to do this on a microcontroller is stick some debugging messages every few lines, like this:
... a few lines of setup code ....
Serial.println("setup: 1");
a few more lines of setup code ...
Serial.println("setup: 2");
etc.
You can start this a few lines after the TRIMS: unset message since we already know the code got at least that far.
So then you run the program and where the messages suddenly stop coming out. You could then refine the exact line of code by adding a couple more prints.
If you can isolate the exact line of code where things go sideways, that will give us a major clue where to look.
Hope this helps,
Steve P.