本文整理汇总了Python中wiringpi.wiringPiSetupGpio方法的典型用法代码示例。如果您正苦于以下问题:Python wiringpi.wiringPiSetupGpio方法的具体用法?Python wiringpi.wiringPiSetupGpio怎么用?Python wiringpi.wiringPiSetupGpio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wiringpi
的用法示例。
在下文中一共展示了wiringpi.wiringPiSetupGpio方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initOS
# 需要导入模块: import wiringpi [as 别名]
# 或者: from wiringpi import wiringPiSetupGpio [as 别名]
def initOS():
os.environ['SDL_FBDEV'] = '/dev/fb1'
os.environ['SDL_MOUSEDEV'] = '/dev/input/touchscreen'
os.environ['SDL_MOUSEDRV'] = 'TSLIB'
os.environ['SDL_VIDEODRIVER'] = 'fbcon'
try:
# if this system has the newer screen control then turn off the SMTPE control so PWM works
with open('/sys/class/backlight/soc:backlight/brightness', 'w') as f:
f.write('0')
except:
pass
wiringpi.wiringPiSetupGpio()
wiringpi.pinMode(18, 2)
wiringpi.pwmSetMode(wiringpi.PWM_MODE_MS) # default balanced mode makes screen dark at about 853/1024
wiringpi.pwmWrite(18, 1024)
示例2: pwr_on
# 需要导入模块: import wiringpi [as 别名]
# 或者: from wiringpi import wiringPiSetupGpio [as 别名]
def pwr_on():
# Utiliser la numerotation GPIO
wiringpi.wiringPiSetupGpio()
# Mettre le GPIO en mode sortie = 1
wiringpi.pinMode(POWER_KEY_GPIO,1)
# Envoyer une impulsion au SIM800C
wiringpi.digitalWrite(POWER_KEY_GPIO,1)
time.sleep(1)
wiringpi.digitalWrite(POWER_KEY_GPIO,0)
# Avertir l'utilisateur
s = "The SIM800C has booted"
print s
return;