数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

DFR0566 数据表(PDF) 13 Page - DFROBOT

部件名 DFR0566
功能描述  IO Expansion HAT for Raspberry Pi 4B/3B
PDF  18 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  DFROBOT [DFROBOT]
网页  https://www.dfrobot.com/
标志 DFROBOT - DFROBOT

DFR0566 数据表(HTML) 13 Page - DFROBOT

Back Button DFR0566 Datasheet HTML 9Page - DFROBOT DFR0566 Datasheet HTML 10Page - DFROBOT DFR0566 Datasheet HTML 11Page - DFROBOT DFR0566 Datasheet HTML 12Page - DFROBOT DFR0566 Datasheet HTML 13Page - DFROBOT DFR0566 Datasheet HTML 14Page - DFROBOT DFR0566 Datasheet HTML 15Page - DFROBOT DFR0566 Datasheet HTML 16Page - DFROBOT DFR0566 Datasheet HTML 17Page - DFROBOT Next Button
Zoom Inzoom in Zoom Outzoom out
 13 / 18 page
background image
import time
from DFRobot_RaspberryPi_Expansion_Board import DFRobot_Expansion_Board_IIC as Board
from DFRobot_RaspberryPi_Expansion_Board import DFRobot_Expansion_Board_Servo as
Servo
board = Board(1, 0x10)
# Select i2c bus 1, set address to 0x10
servo = Servo(board)
''' print last operate status, users can use this variable to determine the result of
a function call. '''
def print_board_status():
if board.last_operate_status == board.STA_OK:
print("board status: everything ok")
elif board.last_operate_status == board.STA_ERR:
print("board status: unexpected error")
elif board.last_operate_status == board.STA_ERR_DEVICE_NOT_DETECTED:
print("board status: device not detected")
elif board.last_operate_status == board.STA_ERR_PARAMETER:
print("board status: parameter error")
elif board.last_operate_status == board.STA_ERR_SOFT_VERSION:
print("board status: unsupport board framware version")
if __name__ == "__main__":
while board.begin() != board.STA_OK:
# Board begin and check board status
print_board_status()
print("board begin faild")
time.sleep(2)
print("board begin success")
servo.begin()
# servo control begin
while True:
print("servo move to 0")
servo.move(board.ALL, 0)
time.sleep(1)
print("servo move to 180")
servo.move(board.ALL, 180)
time.sleep(1)
print("part servos move to 0")
servo.move(0, 0)
#pwm0
#servo.move(1, 0)
#pwm1
#servo.move(2, 0)
#pwm2
#servo.move(3, 0)
#pwm3
time.sleep(1)
print("part servos move to 180")
servo.move(0, 180)
#pwm0
#servo.move(1, 180)
#pwm1
#servo.move(2, 180)
#pwm2
#servo.move(3, 180)
#pwm3
time.sleep(1)



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com