You are browsing as a guest. Sign up (or log in) to start making projects!

3h 12m 7s logged

I started with a robot that has two back wheels and a ball caster, so I knew the robot needed tank‑style control.

That meant one joystick should only move the robot forward and backward, and the other joystick should only turn it left and right.

I kept trying to wire the joysticks and write the code, but every time I moved joystick one left or right, numbers still showed up even though I only wanted up and down.

Then joystick two kept giving numbers when I moved it up or down, even though I only wanted left and right. I tried ignoring the extra axes by forcing them to zero, but I accidentally used JOY2_VERTICAL even though I never defined it, which caused the compile error.

I removed that line and simplified everything so the robot only listens to A0 for forward and A3 for turning. After fixing the mistakes, the code finally compiled and matched exactly what I wanted: joystick one only controls forward and backward, joystick two only controls turning, and all unwanted directions are ignored.

0
5

Comments 0

No comments yet. Be the first!