Book Image

Intel Galileo Blueprints

By : Marco Schwartz
Book Image

Intel Galileo Blueprints

By: Marco Schwartz

Overview of this book

Table of Contents (19 chapters)
Intel Galileo Blueprints
About the Author
About the Reviewers
Free Chapter
Setting Up the Galileo Board and the Development Environment

Using the servomotor controller

After we have assembled the servomotor controller circuit, we need to work on the Arduino sketch of the servomotor controller.

However, before that, you need to know that we need to match the turn of our potentiometer to the change on the angle of the servomotor. We should be wary of the potentiometer and be extra careful of our precision. We want our servomotor to give a relevant change with the turn that we make on our potentiometer.

Since we are using the Galileo board Gen 2, this wouldn't be a problem. Thanks to its 12-bit PWM output, we can be ensured of precision control.

Galileo Gen 2 makes use of an NXP PCA9685 PWM driver IC with 12-bit resolution. This is what makes a fine-grained control on the PWM duty cycle possible.

At this time, we are ready to write the code which will enable us to control the servomotor through the potentiometer, by following these steps:

  1. The first thing that we should do is include the servo library, so that we will have codes...