Go Down

Topic: Motor control after making a turn (Read 2905 times) previous topic - next topic


Doing an unconditional state++ after the switch statement isn't going to work for all cases. Consider case 9; there's a timing condition that must be satisfied before moving on to the next state. It is a slightly unusual application of a state machine though as there's no possibility of choosing a new path through your states at run time - you could simply write it sequentially (though I can see no reason to).

It sounds like the system will simply dead reckon its way round the maze and state 11 is a means to effectively end the program by using the default case. If so, presumably case 10 will have the ball drop code added.

Nick Gammon

Fair enough. Disregard my suggestion, I hadn't thought it through. :)
Please post technical questions on the forum, not by personal message. Thanks!

More info:


the ball drop will be controlled either by a relay or by some mechanical latch or sorts, depending on the budget.

Well i reckon the movement part is done, Cheers again for the help guys, much appreciated :)

Hopefully this works on the actual robot


Hopefully this works on the actual robot

If you haven't tested with the actual hardware yet, might I suggest that you do so soon? You will likely discover all sorts of minor issues that'll need work.


yup were testing it this coming week

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131