The circuit below allows Vout control using either PWM or an analog voltage.  


<!-- Begin schematic: In order to preserve an editable schematic, please
     don't edit this section directly.
     Click the "edit" link below the image in the preview instead. -->

![schematic](https://i.sstatic.net/unnMS.png)

<!-- End schematic -->