Ejemplo n.º 1
0
 def setup_pir(self, resistor=False):
     if not resistor:
         GPIO.setup(self.pinP, GPIO.IN)
     elif resistor:
         GPIO.set(self.pinP, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
     else:
         print('Pir error')
Ejemplo n.º 2
0
 def setup_pir(self, resistor=False):
     if not resistor:
         GPIO.setup(self.pinP, GPIO.IN)
     elif resistor:
         GPIO.set(self.pinP, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
     else:
         print('Pir error')
Ejemplo n.º 3
0
 def pulseGPIOPin(self, pin):
     GPIO.set(pin, HIGH)
     self.microsecond()
     GPIO.set(pin, LOW)
Ejemplo n.º 4
0
 def write_low(self, pin):
     if pin not in self.pins_dict.keys():
         raise RuntimeError("Pin [%d] is not set as output.")
     if not self.simulation:
         gpio.set(pin, gpio.HIGH)
Ejemplo n.º 5
0
import RPi.GPIO as GPIO
import time
//pin led
pin = 7
GPIO.setmode()
GPIO.set(pin,GPIO.OUT)