View Single Post
  #8   Spotlight this post!  
Unread 14-01-2008, 23:34
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,744
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: Getting constant motor power with IR board

One thing that might help you quite a bit would be to lay everything out in a state diagram, or a state machine. Wikipedia does an ok job with the general idea, with a few decent pictures. http://en.wikipedia.org/wiki/State_machine

The basic concept is to draw a bubble to represent discrete thing you want your robot to do during hybrid mode (for example, drive straight, turn to the left, stop). Then you draw arrows between the state and set conditions for those transitions. For example, you might have an arrow to the stop state and trigger that with a "4" signal. Then an arrow from stop to drive forward with a "1" signal. Other cases, you might have it time based - drive forward, and 5 seconds later turn left 180 degrees.

State machines are extremely powerful things, and are especially great for an application like this.