Jump to content

NodeMCU Projects: Difference between revisions

Line 111:
 
*Control a hobby servo
 
Hobby servo motors can be controlled using PWM.
They require a frequency of 50Hz and a duty between about 40 and 115, with 77 being the center value.
 
<syntaxhighlight lang="python">
servo = machine.PWM(machine.Pin(12), freq=50)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.