I found this online.
something like this should get the job done. I think however the resulting signal will be inverted, which should be an easy fix with an inverting object in your patch.
<img src="/uploads/default/original/2X/0/08966c2ca21ef5cc185f3a0cdf319607fb467993.JPG" width="513" height="371">
"microcontroller" will be the Axo GPIO PWM out signal @ 3.3v.
vOUT goes to the motor.
If you don't have a 2N2222 just do a search for an equivalent. There should be many to choose from.
The PWM cycle will control both speed and thrust.
Not sure how big your motor is, the circuit may be overkill, but should work. I expect you should not have much issue with a slightly larger motor.