本文整理匯總了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;