diff options
Diffstat (limited to 'docs/quickref.rst')
-rw-r--r-- | docs/quickref.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/quickref.rst b/docs/quickref.rst index 5c3c7a7b2c..2a1429cb05 100644 --- a/docs/quickref.rst +++ b/docs/quickref.rst @@ -48,6 +48,18 @@ See :ref:`pyb.Pin <pyb.Pin>`. :: p_in = Pin('X2', Pin.IN, Pin.PULL_UP) p_in.value() # get value, 0 or 1 +Servo control +------------- + +See :ref:`pyb.Servo <pyb.Servo>`. :: + + from pyb import Servo + + s1 = Servo(1) # servo on position 1 (X1, VIN, GND) + s1.angle(45) # move to 45 degrees + s1.angle(-60, 1500) # move to -60 degrees in 1500ms + s1.speed(50) # for continuous rotation servos + External interrupts ------------------- |