简体   繁体   English

Coral edge TPU 问题连接和控制伺服器

[英]Coral edge TPU problems connecting and controlling a servo

I'm having problems with coral board edge tpu interacting with a servo micro SG90.我遇到了珊瑚板边缘 tpu 与伺服微型 SG90 交互的问题。 I don't think that the problem is in the code because I tried it on the reaspberry pi and it worked, maybe the problem is the power voltage of the coral dev board.我不认为问题出在代码上,因为我在 reaspberry pi 上尝试过并且有效,也许问题在于珊瑚开发板的电源电压。 Should I buy a separate battery pack to power the servo or is there another way?我应该购买一个单独的电池组来为伺服供电还是有其他方法?

this is the circuit I'm using这是我正在使用的电路

and this is the code:这是代码:

import time导入时间

import board进口板

import pulseio进口脉冲

from adafruit_motor import servo from adafruit_motor 进口伺服

pwm = pulseio.PWMOut(board.PWM3, duty_cycle=2 ** 15, frequency=50) pwm = pulseio.PWMOut(board.PWM3, duty_cycle=2 ** 15, frequency=50)

my_servo = servo.Servo(pwm) my_servo = 伺服.Servo(pwm)

while True:为真:

for angle in range(0, 180, 5):  
    my_servo.angle = angle
    time.sleep(0.05)

for angle in range(180, 0, -5): 
    my_servo.angle = angle
    time.sleep(0.05)

The Coral-Dev-Board PWMs are per default configured as Open-Drain outputs, which means they toggle between "GND" and "Not Connected". Coral-Dev-Board PWM 默认配置为开漏输出,这意味着它们在“GND”和“未连接”之间切换。 Pi PWMs toggle between "GND" and "+3.3V". Pi PWM 在“GND”和“+3.3V”之间切换。 Search for "Open-Drain" or "Open-Collector" and you will find examples on how to add some resistors/ transistors to you bread-board to be able to communicate with the servo.搜索“漏极开路”或“集电极开路”,您将找到有关如何向面包板添加一些电阻器/晶体管以便能够与伺服进行通信的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM