1 / 23

Programming - Motion

Programming - Motion. Intro to Robotics. Motor Command. The motor command tells the robot to run a motor at a given power level. The example below sets the motor on port 3 to run at full power forwards. Remember, every command ends with a semicolon. Wait Command.

zorina
Download Presentation

Programming - Motion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming - Motion Intro to Robotics

  2. Motor Command The motor command tells the robot to run a motor at a given power level. The example below sets the motor on port 3 to run at full power forwards. Remember, every command ends with a semicolon.

  3. Wait Command The comment wait1Msec tells the robot to wait before it executes the next command, for a given time in milliseconds. The value in parenthesis is the amount of time you want the robot to wait. 3000Ms is equal to 3 seconds.

  4. What happened????

  5. bMotorReflected One way to correct this problem is by using the bMotorReflected statement. To reverse the polarity of the motor, set this statement equal to 1. This reverses the direction in which the motor spins. Reversing the direction of one motor makes it easier to use reflected motors. The same motor command can then be used to run both motors.

  6. Modify this code. Since we are moving at half power lets double our time.

  7. Modify the code, then compile and download. Note what happens.

  8. Modify the code below, then compile and download each time. Note what happens.

  9. Manual Straightening To compensate for the differences between the motors, we could either speed up the slower motor or slow down the faster one. Let’s slow down the faster one.

  10. Save the code with a filename you will remember in your MY DOCUMENTS folder.

More Related