zephyr/samples/basic/servo_motor
Anas Nashif da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
..
src all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
CMakeLists.txt cmake: increase minimal required version to 3.13.1 2019-01-03 11:51:29 -05:00
README.rst doc: samples: Update samples to point to active boards 2018-12-12 23:06:16 +01:00
bbc_microbit.overlay samples: servo_motor: Fix servo_motor sample to use new DT options 2019-03-12 13:34:01 +01:00
prj.conf
sample.yaml samples: add test identifier 2019-03-29 17:44:11 -04:00

README.rst

.. _servo-motor-sample:

PWM: Servo motor
################

Overview
********

This is a sample app which drives a servo motor using
PWM.

This app is targeted for servo motor ROB-09065. With the
PWM control signal, the servo motor can rotate to any
angle between 0 and 180 degrees. The corresponding PWM
pulse width is between 700 micro seconds and 2300 micro
seconds. The motor is programmed to rotate back and forth
in the 180 degree range.

Since different servo motors may require different PWM
pulse width, you may need to modify the pulse width in
the app if you are using a different servo motor.

Wiring
******

BBC micro:bit
=============

You will need to connect the motor's red wire to external 5V, the
black wire to ground and the white wire to pad 0 on the edge
connector.

Arduino 101 and Quark D2000 CRB
===============================

You will need to connect the motor's red wire to 5V,
the black wire to ground and the white wire to PWM 0 via
the shield.


Building and Running
********************

This sample can be built for multiple boards, in this example we will build it
for the arduino_101 board:

.. zephyr-app-commands::
   :zephyr-app: samples/basic/servo_motor
   :board: bbc_microbit
   :goals: build flash
   :compact: