yjh5371
yjh5371 Lv0  
楼主
求教运行小车程序提示AttributeError: 'int' object has no attribute 'GPIO' 树莓派
查看:2904   回复:2   发布于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'是什么原因

 
回复列表
默认   热门   正序   倒序
Litbeginner
3F
搜了一大圈,就这里也有这个问题


 0   2021-10-07 20:00:17 回复
Litbeginner
2F
同求


 0   2021-10-07 19:59:49 回复

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

Powered by Raspigeek 7.3.1

©2015 - 2022 树莓派极客网

网站首页 联系站长

您的IP:3.238.72.180,2022-12-07 00:14:57,Processed in 0.09958 second(s).