gpiojoypwm

GPIO Joy – Pulse Width Modulation

Pulse Width Modulation (PWM) is used to control the speed of a motor or the brightness of an LED wired to the GPIO pin.

In this example, GPIO pin 12 would be controlled using the XBox left trigger input.  The duty cycle would be set from 0 to maximum as you went from off to full trigger joystick input.

<GpioConfig> 
  <PinModes> 
    <Pin> 
      <Name>Motor One</Name> 
      <Number>12</Number> 
      <Mode>PWMOutput</Mode> 
      <Joystick>LeftTrigger</Joystick> 
    </Pin> 
  </PinModes> 
</GpioConfig>