Hacker News new | ask | show | jobs
by gfo 3379 days ago
> We ended up solving the problem by not continously pushing the button down when turning. The further the wheel is turned to the left or right, the greater amount of time the button stays down and the further the car turns.

I'm a little confused at this statement. Does this mean they just had it tapping 'left' or 'right' instead of holding the button down initially?

2 comments

I interpreted it to mean they used pulse-width modulation, varying the % of time the button was being pressed in relationship to how far the wheel was turned. It's the same trick used to control LED brightness, even though the light only has binary ON and OFF states.

https://learn.sparkfun.com/tutorials/pulse-width-modulation

Hi, I'm actually one of the people who wrote this. That's exactly correct.
I think the other way around. If I understand, it started holding the button, which oversteered. That didn't map onto tapping correctly, so that made a little snippet of code to tap.