예제 #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
 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
 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
 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
 def __digitalWrite__(self, channel, value):
     self.checkDigitalChannelExported(channel)
     self.checkPostingValueAllowed()
     GPIO.digitalWrite(channel, value)