mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
* Filled in all the board control examples. Everything works except for DAC. * Moved test drawing scripts to drawing dir and renamed them and added comments. * Filled in all the image filter stuff. There are still some tests that can be renamed, commented, and added to this folder. But, I will do that later. * Fixed motion detection thresholds. * Fixed LCD script comments. * Fixed BLE return value.
20 lines
411 B
Python
20 lines
411 B
Python
# Servo Control Example
|
|
#
|
|
# This example shows how to use your OpenMV Cam to control servos.
|
|
|
|
import time
|
|
from pyb import Servo
|
|
|
|
s1 = Servo(1) # P7
|
|
s2 = Servo(2) # P8
|
|
|
|
while(True):
|
|
for i in range(1000):
|
|
s1.pulse_width(1000 + i)
|
|
s2.pulse_width(1999 - i)
|
|
time.sleep(10)
|
|
for i in range(1000):
|
|
s1.pulse_width(1999 - i)
|
|
s2.pulse_width(1000 + i)
|
|
time.sleep(10)
|