コード例 #1
0
ファイル: gpio.py プロジェクト: Hunter275/webiopi
 def setup(self):
     for g in self.gpio_setup:
         gpio = g["gpio"]
         debug("Setup GPIO %d" % gpio)
         GPIO.setFunction(gpio, g["func"])
         if g["value"] >= 0 and GPIO.getFunction(gpio) == GPIO.OUT:
             GPIO.digitalWrite(gpio, g["value"])
コード例 #2
0
ファイル: gpio.py プロジェクト: Hunter275/webiopi
 def close(self):
     for g in self.gpio_reset:
         gpio = g["gpio"]
         debug("Reset GPIO %d" % gpio)
         GPIO.setFunction(gpio, g["func"])
         if g["value"] >= 0 and GPIO.getFunction(gpio) == GPIO.OUT:
             GPIO.digitalWrite(gpio, g["value"])
コード例 #3
0
ファイル: gpio.py プロジェクト: Hunter275/webiopi
 def __portWrite__(self, value):
     if len(self.export) < 54:
         for i in self.export:
             if GPIO.getFunction(i) == GPIO.OUT:
                 GPIO.digitalWrite(i, (value >> i) & 1)
     else:
         raise Exception("Please limit exported GPIO to write integers")
コード例 #4
0
ファイル: gpio.py プロジェクト: xie-xuan/rpi3-webiopi
 def close(self):
     for g in self.gpio_reset:
         gpio = g["gpio"]
         debug("Reset GPIO %d" % gpio)
         GPIO.setFunction(gpio, g["func"])
         if g["value"] >= 0 and GPIO.getFunction(gpio) == GPIO.OUT:
             GPIO.digitalWrite(gpio, g["value"])
コード例 #5
0
ファイル: gpio.py プロジェクト: xie-xuan/rpi3-webiopi
 def setup(self):
     for g in self.gpio_setup:
         gpio = g["gpio"]
         debug("Setup GPIO %d" % gpio)
         GPIO.setFunction(gpio, g["func"])
         if g["value"] >= 0 and GPIO.getFunction(gpio) == GPIO.OUT:
             GPIO.digitalWrite(gpio, g["value"])
コード例 #6
0
ファイル: gpio.py プロジェクト: xie-xuan/rpi3-webiopi
 def __portWrite__(self, value):
     if len(self.export) < 54:
         for i in self.export:
             if GPIO.getFunction(i) == GPIO.OUT:
                 GPIO.digitalWrite(i, (value >> i) & 1)
     else:
         raise Exception("Please limit exported GPIO to write integers")
コード例 #7
0
ファイル: gpio.py プロジェクト: Hunter275/webiopi
 def __digitalWrite__(self, channel, value):
     self.checkDigitalChannelExported(channel)
     self.checkPostingValueAllowed()
     GPIO.digitalWrite(channel, value)
コード例 #8
0
ファイル: gpio.py プロジェクト: xie-xuan/rpi3-webiopi
 def __digitalWrite__(self, channel, value):
     self.checkDigitalChannelExported(channel)
     self.checkPostingValueAllowed()
     GPIO.digitalWrite(channel, value)