View Single Post
  #10   Spotlight this post!  
Unread 21-01-2015, 10:38
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: How to Program the encoder?

Quote:
Originally Posted by Qbot2640 View Post
We want to use the encoders to "measure" a specific distance, so we can program the robot to move "x...feet" and then stop (or do "whatever"). We also want to use the encoder output to compare movement from left and right and correct drift.
That's a good high-level goal. Do you have any thoughts about how you would go about doing it? The encoder value is essentially the distance measurement you're looking for, so that part is already available to you.

Comparing the encoder outputs is a simple matter of subtracting one from the other. When the values are the same, both sides of the robot have gone the same distance. When they differ, the robot has turned. You can use the difference to control the "X" input of an Arcade Drive function, so that the robot turns toward the direction of making the values the same again.

Quote:
Please understand...I agree that the examples provide information, but I have to believe that there are many users like me who have tried hard to fill in the blanks and just can't figure it out. A simple example of one of these "blanks" is where to put the code given in the examples....begin?....periodic tasks?....The examples are not at all "beginner friendly."
Have you looked at the LabVIEW Tutorials? You want Tutorial 7, which tells you how to integrate examples into your robot code.