문제

나는 최근에 Raspberry Pi로 5 핀 서보 모터를 제어하고자하는 프로젝트에서 일하고 있습니다.

5 핀 서보 모터

나는 자원을 검색하고 ADAFRUIT의 서보 모터를 3 핀으로 발견했습니다. 이것은 Adafruit의 3 핀 서보 모터

문제 :

5 핀과 3 핀 서보 모터의 차이점은 무엇입니까? 둘 다 동일한 경우이 5 핀 서보 모터에 대한 핀이 켜져 있습니까?

이것은 3 핀 서보 모터의 소스 코드입니다.

    # Servo Control
import time
def set(property, value):
try:
f = open("/sys/class/rpi-pwm/pwm0/" + property, 'w')
f.write(value)
f.close()   
except:
print("Error writing to: " + property + " value: " + value)


def setServo(angle):
set("servo", str(angle))
set("delayed", "0")
set("mode", "servo")
set("servo_max", "180")
set("active", "1")

delay_period = 0.01

while True:
for angle in range(0, 180):
setServo(angle)
time.sleep(delay_period)
for angle in range(0, 180):
setServo(180 - angle)
time.sleep(delay_period)
.

5 핀 서보 모터를 제어하기 위해 어떤 수정을 수행해야합니까?주요 수정이 있습니까?

도움이 되었습니까?

해결책

서보가 아닌

.그것은 5 핀 스테퍼 모터입니다. Uni-Polar 드라이버가 필요합니다

다른 팁

I found out that, well u can connect a stepper motor or servo motor or dc motor for your Raspbberi Pi. Check the link for adafruit's stepper motor connection to raspberry pi.

Raspberry Pi stepper motor connection

If u see some more lessons you will find that you can connect dc,stepper or servo motor to your Pi.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top