message: add documentation for PWM input
diff: @@ -17,6 +17,7 @@ The ODrive can be controlled over various ports and protocols.
  - [Native Protocol](#native-protocol)
  - [ASCII Protocol](#ascii-protocol)
  - [Step/direction](#stepdirection)
  + - [RC PWM input](#rc-pwm-input)
  <!-- /MarkdownTOC -->
  @@ -111,3 +112,29 @@ There is also a config variable called `<axis>.config.counts_per_step`, which sp
  The maximum step rate is pending tests, but it should handle at least 16kHz. If you want to test it, please be aware that the failure mode on too high step rates is expected to be that the motors shuts down and coasts.
  Please be aware that there is no enable line right now, and the step/direction interface is enabled by default, and remains active as long as the ODrive is in position control mode. By default the ODrive starts in position control mode, so you don't need to send any commands over USB to get going. You can still send USB commands if you want to.
  +
  +### RC PWM input
  +
  +You can control the ODrive directly from an hobby RC receiver.
  +
  +Up to 4 channels (GPIOs 1, 2, 3 and 4) can be used simultaneously if the respective pins are not assigned to other functions. Any of the numerical parameters that are writable from the ODrive Tool can be hooked up to a PWM input.
  +
  +As an example, we'll configure GPIO4 to control the angle of axis 0. We want the axis to move within a range of -1500 to 1500 encoder counts.
  +
  +1. Make sure you're able control the axis 0 angle by writing to `odrv0.axis0.controller.pos_setpoint`. If you need help with this follow the [getting started guide](getting-started.md).
  +2. It is recommended that you configure the ODrive such that axis 0 automatically goes operational after a reboot. You may have to set `odrv0.axis0.config.startup_encoder_offset_calibration` and `odrv0.axis0.config.startup_closed_loop_control` to `True`. The exact procedure may vary depending on what type of encoder you're using.
  +3. In ODrive Tool, configure the PWM input mapping
  + ```
  + In [1]: odrv0.config.gpio4_pwm_mapping.min = -1500
  +
  + In [2]: odrv0.config.gpio4_pwm_mapping.max = 1500
  +
  + In [3]: odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis0.controller._remote_attributes['pos_setpoint']
  + ```
  +4. Save the configuration and reboot
  + ```
  + In [4]: odrv0.save_configuration()
  +
  + In [5]: odrv0.reboot()
  + ```
  +5. Connect the RC receiver ground to the ODrive's GND and one of the RC receiver signals to GPIO4. You may try to power the receiver from the ODrive's 5V supply if it doesn't draw too much power. Power up the the RC transmitter. You should now be able to control axis 0 from one of the RC sticks.
  