當前位置: 首頁>>代碼示例>>Python>>正文


Python wiringpi.wiringPiSetup方法代碼示例

本文整理匯總了Python中wiringpi.wiringPiSetup方法的典型用法代碼示例。如果您正苦於以下問題:Python wiringpi.wiringPiSetup方法的具體用法?Python wiringpi.wiringPiSetup怎麽用?Python wiringpi.wiringPiSetup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wiringpi的用法示例。


在下文中一共展示了wiringpi.wiringPiSetup方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: init

# 需要導入模塊: import wiringpi [as 別名]
# 或者: from wiringpi import wiringPiSetup [as 別名]
def init():
	print(lirc_device)
	wiringpi.wiringPiSetup()
	wiringpi.pinMode(A_1_PIN,INPUT)
	wiringpi.pullUpDnControl(A_1_PIN,PUD_UP)
	wiringpi.pinMode(B_1_PIN,INPUT)
	wiringpi.pullUpDnControl(B_1_PIN,PUD_UP)
	wiringpi.pinMode(BTN_1_PIN,INPUT)
	wiringpi.pullUpDnControl(BTN_1_PIN,PUD_UP)

	wiringpi.pinMode(A_2_PIN,INPUT)
	wiringpi.pullUpDnControl(A_2_PIN,PUD_UP)
	wiringpi.pinMode(B_2_PIN,INPUT)
	wiringpi.pullUpDnControl(B_2_PIN,PUD_UP)
	wiringpi.pinMode(BTN_2_PIN,INPUT)
	wiringpi.pullUpDnControl(BTN_2_PIN,PUD_UP)

	wiringpi.pinMode(POWER_PIN,INPUT)
	wiringpi.pullUpDnControl(POWER_PIN,PUD_UP)

	thread.start_new_thread(encoder_loop, ())
	thread.start_new_thread(keypressd, (lirc_device, )) 
開發者ID:thk4711,項目名稱:orangepi-radio,代碼行數:24,代碼來源:input_rot_only.py

示例2: __init__

# 需要導入模塊: import wiringpi [as 別名]
# 或者: from wiringpi import wiringPiSetup [as 別名]
def __init__(self, logger, d = 20, motor_setup = 0, motor_driver = 1,\
               pid = 1, reset = 1, r = 10):
    self.logger = logger
    GPIO.setmode(GPIO.BCM)
    self.GPIO = GPIO
    self.motor_controller = motor_setup
    self.motor_driver = motor_driver
    if motor_driver == gpio:
      self.driver = motor_drivers.ada_motor_driver(GPIO, logger)
    elif motor_driver == i2c:
      self.driver = motor_drivers.i2c_motor_driver(logger)
    if motor_setup == mecanum:
      self.controller = motor_controllers.mecanum(logger)
      if motor_driver == i2c:
        self.driver.init_module(pid,reset,4)
    elif motor_setup == differential:
      self.controller = motor_controllers.differential(d)
      if motor_driver == i2c:
        self.driver.init_module(pid,reset,2)

    #TODO: write motor_setup == omni
    #TODO: fix wiringpi
    #    wiringpi.wiringPiSetup()
    #    wiringpi.pinMode(1, 2) 
開發者ID:HisarCS,項目名稱:cuneyt,代碼行數:26,代碼來源:motor_controller.py

示例3: __init__

# 需要導入模塊: import wiringpi [as 別名]
# 或者: from wiringpi import wiringPiSetup [as 別名]
def __init__(self):
        import wiringpi
        wiringpi.wiringPiSetup()
        self.engauged = False 
開發者ID:pypilot,項目名稱:pypilot,代碼行數:6,代碼來源:servo.py

示例4: volumio_buddy_setup

# 需要導入模塊: import wiringpi [as 別名]
# 或者: from wiringpi import wiringPiSetup [as 別名]
def volumio_buddy_setup():
    """ Setup WiringPi and ensure that it is only executed once """
    global _volumio_buddy_is_setup
    if not '_volumio_buddy_is_setup' in globals():
        _volumio_buddy_is_setup = True
        wiringpi.wiringPiSetup()
    elif not _volumio_buddy_is_setup == True:
        _volumio_buddy_is_setup = True
        wiringpi.wiringPiSetup() 
開發者ID:foxey,項目名稱:volumio-buddy,代碼行數:11,代碼來源:volumio_buddy.py

示例5: __init__

# 需要導入模塊: import wiringpi [as 別名]
# 或者: from wiringpi import wiringPiSetup [as 別名]
def __init__(self):
        wiringpi.wiringPiSetup()
        self.i2c = wiringpi.I2C()
        self.dev = self.i2c.setup(0x40) 
開發者ID:naoki-sawada,項目名稱:homebot,代碼行數:6,代碼來源:temphudi.py


注:本文中的wiringpi.wiringPiSetup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。