Controlling Servo Motor

Servo Sample Connectivity

In this blog post, I’ll show you how to control a servo motor with a UWP App installed on a Raspberry Pi 2, running Windows 10 IoT Core.

Step One:

You need to connect your Servo Motor to the Raspberry Pi 2 as show in scheme:

Servo Sample Scheme

Step Two:

Now, you should write the code that will control the servo motor, you will find the source code HERE
Clone this code, and you will find two methods: PWM_R() which will make the servo motor rotate to the right and PWM_L() which will make the servo motor rotate to the left.

and you’ll find also the event handler which will be invoked each time you press the push button.

 

And here’s a video of the result you should get: