Hi everyone !
I started using mBlock to program mBot not so long ago, and I’m having a lot of fun !
Lastly I tried to make a sumo program for the association where I work. It was a struggle but it ended up working and I was very happy.
But at some point I noticed a priority issue : there’s a round arena that is black, with white stripes all around. If the mBot sees an obstacle, it accelerates.
The issue being that it accelerates even if the obstacle is outside the ring, and it prioritize this acceleration, while the goal is to stay in the ring as long as possible.
I searched a lot since, and found some interesting things, I started using a variable wich gave more control overall.
Last week I finally found a solution to the issue. If I shorten the time of acceleration, it will accelerate but then stop if there’s a white line in sight.
But now I’m facing a new problem… The acceleration is totally jerky.
I can make the mBot accelerate longer but it increases the risk of it going out of the ring.
So here’s my question : is there a way to make it smoother - while keeping a short time of reaction to a white line ?
Thanks in advance for any answer.
Here’s the code I’ve made :