Make an Arduino-Controlled Robot by Michael Margolis

Make an Arduino-Controlled Robot by Michael Margolis

Author:Michael Margolis [Michael Margolis]
Language: eng
Format: epub, pdf
Tags: TECHNOLOGY & ENGINEERING / Robotics
ISBN: 9781449344320
Publisher: Make
Published: 2012-10-18T16:00:00+00:00


Functions to Encapsulate Robot Movements

You can simplify your code for controlling your robot's behaviour by using higher level movement functions provided in the Move module. These functions reference the desired movement from the robot's perspective rather than specific motor control. For example, to rotate the robot, rather than calling functions to run one motor forwards and the other backwards, you can call a single function that rotates the robot. And by calibrating the speed of rotation, you can easily get the robot to rotate to any desired angle.

The sketch named myRobotMove has the movement code in a tab called Move. That sketch is similar to the myRobot sketch from Making the Sketch Easy to Enhance but uses the rotation functions in the Move tab to drive the robot. Using the higher level functions to drive the robot not only simplifies your code, it isolates the sketch logic from the hardware specific motor code. The sketches in all of the following chapters control robot movement through the functions in the Move tab.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.