Skip to Content
Hands-On Robotics Programming with C++
book

Hands-On Robotics Programming with C++

by Dinesh Tavasalkar
March 2019
Intermediate to advanced
312 pages
7h 37m
English
Packt Publishing
Content preview from Hands-On Robotics Programming with C++

Axial left turn

In an axial left turn, the left motor of the robot moves backward and the right motor moves forward, so the robot takes a left turn, as shown in the following diagram:

If you have understood how the H-bridge works, you might be able to guess the code for taking an axial turn. If not, the code is as follows:

digitalWrite(0,LOW);digitalWrite(2,HIGH);digitalWrite(3,HIGH);digitalWrite(4,LOW);delay(500);
You will need to play around with the delay value a little bit to make sure that the robot is turning properly in the left direction. If the delay value is high, the robot will turn more than 90°, whereas if it is low, the robot ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Robotics Programming

Learn Robotics Programming

Danny Staple
C++ Reactive Programming

C++ Reactive Programming

Praseed Pai, Peter Abraham

Publisher Resources

ISBN: 9781789139006Supplemental Content