Pages: 1 [2]   Go Down
Author Topic: Motor control after making a turn  (Read 1333 times)
0 Members and 1 Guest are viewing this topic.
New Jersey
Online Online
Faraday Member
**
Karma: 72
Posts: 3764
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19367
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Fair enough. Disregard my suggestion, I hadn't thought it through. smiley
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

Hopefully this works on the actual robot
Logged

New Jersey
Online Online
Faraday Member
**
Karma: 72
Posts: 3764
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yup were testing it this coming week
Logged

Pages: 1 [2]   Go Up
Jump to: