yjh5371
yjh5371 Lv0  
楼主
求教运行小车程序提示AttributeError: 'int' object has no attribute 'GPIO' 树莓派
查看:390   回复:0   发布于2019-11-07 11:25:45
求教运行小车程序

代码import RPi.GPIO as GPIO

import time

GPIO.setmode(GPIO.BOARD)


INT1 = 11

INT2 = 12

INT3 = 13

INT4 = 15


GPIO.setup(INT1.GPIO.OUT)

GPIO.setup(INT2.GPIO.OUT)

GPIO.setup(INT3.GPIO.OUT)

GPIO.setup(INT4.GPIO.OUT)


GPIO.output(INT1.GPIO.HIGH)

GPIO.output(INT2.GPIO.LOW)

GPIO.output(INT3.GPIO.HIGH)

GPIO.output(INT4.GPIO.LOW)


time.sleep(2)


GPIO.cleanup()


最后提示AttributeError: 'int' object has no attribute 'GPIO'是什么原因

 
回复列表
默认   热门   正序   倒序

回复:求教运行小车程序提示AttributeError: 'int' object has no attribute 'GPIO'

Powered by Raspigeek RASPIGEEK_VERSION

©2015 - 2020 树莓派极客论坛

官方网站 联系站长

您的IP:3.235.75.196,2020-04-02 19:22:08,Processed in 0.06813 second(s).