Python RPi.GPIO 模块,cleanup() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用RPi.GPIO.cleanup()

项目:raspi-photo-booth    作者:kriskbx    | 项目源码 | 文件源码
def setup():
    if os.path.isdir(ImagePath) == False:
        os.mkdir(ImagePath, 0777)

    try:
        GPIO.cleanup()
    finally:
        pass

    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(BeepPin, GPIO.OUT)
    GPIO.setup(LedPin, GPIO.OUT)
    GPIO.setup(ButtonPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)

    ledOn()
    beepOn()
    time.sleep(0.1)
    ledOff()
    beepOff()

# Loop, wait for button press
项目:RaspberryPi-Robot    作者:timestocome    | 项目源码 | 文件源码
def reverse(t=wheel_pulse/2):

    gpio.output(reverse_left, gpio.HIGH)
    gpio.output(reverse_right, gpio.HIGH)

    sleep(t)
    gpio.output(reverse_left, gpio.LOW)
    gpio.output(reverse_right, gpio.LOW)





##########################################################################
# cleanup
##########################################################################
项目:Adafruit_Python_MAX31856    作者:johnrbnsn    | 项目源码 | 文件源码
def tearDown(self):
        GPIO.cleanup()

    #def test_software_spi_initialize(self):
        #'''Checks to see if the sensor can initialize on the software SPI interface.

        #Will fail if it cannot find the MAX31856 library or any dependencies.
        #Test only checks to see that the sensor can be initialized in Software, does not check the
        #hardware connection.
        #'''
        #_logger.debug('test_software_SPI_initialize()')
        ## Raspberry Pi software SPI configuration.
        #software_spi = {"clk": 25, "cs": 8, "do": 9, "di": 10}
        #sensor = MAX31856(software_spi=software_spi)

        #if sensor:
            #self.assertTrue(True)
        #else:
            #self.assertTrue(False)
项目:photobooth    作者:LoiX07    | 项目源码 | 文件源码
def quit(self):
        """ Cleanup function """
        log.debug("Quitting")
        log.debug("Cleaning the photobooth")
        self.queue.put("exit")
        self.camera.close()
        self.lamp.set_level(0)
        self.count_display.switch_off()
        GPIO.output(self.trigger_led_channel, 0)
        GPIO.output(self.shutdown_led_channel, 0)
        GPIO.cleanup()
        sys.exit()


#################
### Functions ###
#################
项目:burro    作者:yconst    | 项目源码 | 文件源码
def __init__(self, channel, invert=False):
        from navio import adafruit_pwm_servo_driver as pwm
        from navio import util
        import RPi.GPIO as GPIO
        util.check_apm()

        #Navio+ requires the GPIO line 27 to be set to low 
        #before the PCA9685 is accesed 
        GPIO.setwarnings(False)
        GPIO.setmode(GPIO.BCM)
        GPIO.setup(27, GPIO.OUT)
        GPIO.output(27,GPIO.LOW)

        #GPIO.cleanup()
        self.frequency = 60
        self.channel = channel
        self.invert = invert
        self.pwm = pwm.PWM()
        self.pwm.setPWMFreq(self.frequency)
项目:52-Weeks-of-Pi    作者:grantwinney    | 项目源码 | 文件源码
def main():
    try:
        while True:
            for led in LEDS:
                for idx, pin in enumerate(led):
                    if pin == O:
                        GPIO.setup(PINS[idx], GPIO.IN)
                    else:
                        GPIO.setup(PINS[idx], GPIO.OUT)
                        GPIO.output(PINS[idx], pin)
                time.sleep(.1)

    except KeyboardInterrupt:
        pass

    finally:
        GPIO.cleanup()
项目:raspberry-gpio-emulator    作者:nosix    | 项目源码 | 文件源码
def main():
    import RPi.GPIO as GPIO

    try:
        print('UNKNOWN:%d' % GPIO.UNKNOWN)
        print('SERIAL:%d' % GPIO.SERIAL)
        print('SPI:%d' % GPIO.SPI)
        print('I2C:%d' % GPIO.I2C)
        print('HARD_PWM:%d' % GPIO.HARD_PWM)

        GPIO.setmode(GPIO.BOARD)

        GPIO.setup(3, GPIO.OUT)

        for pin in range(1, 41):
            try:
                print('%02d: %d' % (pin, GPIO.gpio_function(pin)))
            except ValueError as ex:
                print(ex)
    finally:
        GPIO.cleanup()
项目:raspberry-gpio-emulator    作者:nosix    | 项目源码 | 文件源码
def main():
    import RPi.GPIO as GPIO
    import time

    GPIO.setmode(GPIO.BCM)
    GPIO.setup(12, GPIO.OUT)
    p = GPIO.PWM(12, 50)
    try:
        p.start(0)
        for dc in range(0, 101, 5):
            p.ChangeDutyCycle(dc)
            time.sleep(0.1)
        for dc in range(100, -1, -5):
            p.ChangeDutyCycle(dc)
            time.sleep(0.1)
    finally:
        p.stop()
        GPIO.cleanup()
项目:raspberry-gpio-emulator    作者:nosix    | 项目源码 | 文件源码
def main():
    import RPi.GPIO as GPIO
    import time

    try:
        GPIO.setmode(GPIO.BCM)

        GPIO.setwarnings(False)

        GPIO.setup(18, GPIO.OUT)
        GPIO.setup(27, GPIO.IN)

        while True:
            time.sleep(1)
    finally:
        GPIO.cleanup()
项目:raspberry-gpio-emulator    作者:nosix    | 项目源码 | 文件源码
def main():
    import RPi.GPIO as GPIO
    import time

    try:
        GPIO.setmode(GPIO.BCM)

        GPIO.setwarnings(False)

        GPIO.setup(18, GPIO.OUT)
        GPIO.setup(27, GPIO.IN)

        while True:
            time.sleep(1)
    finally:
        GPIO.cleanup()
项目:earthquakepi    作者:rgrokett    | 项目源码 | 文件源码
def exit():
    """
    Exit handler, which clears all custom chars and shuts down the display.
    """
    try:
    if not DISPLAY:
            lcd = RPi_I2C_driver.lcd()
            lcd.backlight(0)
        if DEBUG:
            print "exit()"
        GPIO.cleanup()
    except:
        # avoids ugly KeyboardInterrupt trace on console...
        pass


#####


#####
# MAIN HERE
项目:SX127x_driver_for_MicroPython_on_ESP8266    作者:Wei1234c    | 项目源码 | 文件源码
def get_spi(self):             
        spi = None

        try: 
            spi = spidev.SpiDev()
            bus = 0
            device = 0
            spi.open(bus, device)            
            spi.max_speed_hz = 10000000
            spi.mode = 0b00
            spi.lsbfirst = False

        except Exception as e:
            print(e)
            GPIO.cleanup()
            if spi:
                spi.close()
                spi = None

        return spi


    # https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md
    # https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=19489
项目:SX127x_driver_for_MicroPython_on_ESP8266    作者:Wei1234c    | 项目源码 | 文件源码
def get_spi(self):             
        spi = None

        try: 
            spi = spidev.SpiDev()
            bus = 0
            device = 0
            spi.open(bus, device)            
            spi.max_speed_hz = 10000000
            spi.mode = 0b00
            spi.lsbfirst = False

        except Exception as e:
            print(e)
            GPIO.cleanup()
            if spi:
                spi.close()
                spi = None

        return spi


    # https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md
    # https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=19489
项目:RaspberryPi-projects    作者:gary-dalton    | 项目源码 | 文件源码
def button_press_switch(channel):
    global button_status
    GPIO.remove_event_detect(channel)
    logging.info('Button pressed')
    pressed_time = datetime.datetime.now()
    while not GPIO.input(channel):
        time.sleep(.5)
    dif = datetime.datetime.now() - pressed_time
    pressed_time = dif.seconds
    if pressed_time > 6:
        shutdown()
        button_status = BUTTON_SHUTDOWN
    elif pressed_time > 2:
        button_status = BUTTON_MONITOR_SWITCH
    else:
        button_status = BUTTON_SENSOR_SWITCH
    logging.info("Button status = %s", button_status)
    GPIO.add_event_detect(channel, GPIO.FALLING, callback=button_press_switch, bouncetime=200)


# Run cleanup routines
项目:RPiNWR    作者:ke4roh    | 项目源码 | 文件源码
def __enter__(self):
        # Make sure to cleanup GPIO afterward
        if not self.__signals_trapped:
            self.__signals_trapped = True
            for sig in [signal.SIGQUIT, signal.SIGTERM, signal.SIGTSTP]:
                if hasattr(signal.getsignal(sig), '__call__'):
                    deleg = signal.getsignal(sig)

                    def delegate(signum, stack):
                        self.__exit__(None, None, None)
                        deleg(signum, stack)

                    signal.signal(sig, delegate)
                else:
                    def delegate(signum, stack):
                        self.__exit__(None, None, None)

                    signal.signal(sig, delegate)
        return self
项目:RFExplorer-for-Python    作者:RFExplorer    | 项目源码 | 文件源码
def ResetIOT_HW(cls, bMode):
        """Set Raspberry pi GPIO pins and reset RF Explorer device

        Parameters: 
            bMode -- True if the baudrate is set to 500000bps, False to 2400bps
        """
        try:
            import RPi.GPIO as GPIO

            #print("RPi info: " + str(GPIO.RPI_INFO)) #information about your RPi:
            #print("RPi.GPio version: " + GPIO.VERSION) #version of RPi.GPIO:
            GPIO.setwarnings(False)
            GPIO.setmode(GPIO.BOARD)    #refer to the pin numbers on the P1 header of the Raspberry Pi board
            GPIO.setup(12, GPIO.OUT)    #set /reset (pin 12) to output 
            GPIO.output(12, False)      #set /reset (pin 12) to LOW
            GPIO.setup(21, GPIO.OUT)    #set GPIO2 (pin 21) to output
            GPIO.output(21, bMode)      #set GPIO2 (pin 21) to HIGH (for 500Kbps)
            time.sleep(0.1)             #wait 100ms
            GPIO.output(12, True)       #set /reset to HIGH
            time.sleep(2.5)             #wait 2.5sec
            GPIO.setup(21, GPIO.IN)     #set GPIO2 to input
            GPIO.cleanup()              #clean up GPIO channels 

        except RuntimeError:
            print("Error importing RPi.GPIO!  This is probably because you need superuser privileges.  You can achieve this by using 'sudo' to run your script")
项目:Kali-Pi    作者:Re4son    | 项目源码 | 文件源码
def screen_on(retPage, backlightControl):

    if os.environ["KPPIN"] != "1":
        launch_bg=os.environ["MENUDIR"] + "launch-bg.sh"
        process = subprocess.call(launch_bg, shell=True)

    pygame.quit()
    if backlightControl == "3.5r":
        process = subprocess.call("echo '1' > /sys/class/backlight/soc\:backlight/brightness", shell=True)
    elif backlightControl == "4dpi-24":
        process = subprocess.call("echo '80' > /sys/class/backlight/24-hat-pwm/brightness", shell=True)
    else:
        backlight = GPIO.PWM(18, 1023)
        backlight.start(100)
        GPIO.cleanup()
    if os.environ["KPPIN"] == "1":
        page=os.environ["MENUDIR"] + "menu-pin.py"
        args = [page, retPage]
    else:
        page=os.environ["MENUDIR"] + retPage
        args = [page]

    os.execvp("python", ["python"] + args)

# Turn screen off
项目:GBZ-Power-Monitor_BG    作者:Camble    | 项目源码 | 文件源码
def main():
  #if the Low Battery LED is active when the program launches, handle it
  if GPIO.input(batteryGPIO) is 0:
    lowBattery(batteryGPIO)

  #if the Power Switch is active when the program launches, handle it
  if GPIO.input(powerGPIO) is 1:
    powerSwitch(powerGPIO)

  #Add threaded event listeners for the Low Battery and Power Switch
  try:
    GPIO.remove_event_detect(batteryGPIO)
    GPIO.add_event_detect(batteryGPIO, GPIO.FALLING, callback=lowBattery, bouncetime=300)

    GPIO.remove_event_detect(powerGPIO)
    GPIO.add_event_detect(powerGPIO, GPIO.RISING, callback=powerSwitch, bouncetime=300)
  except KeyboardInterrupt:
    GPIO.cleanup()
项目:10-4-a-robot    作者:gruener-campus-malchow    | 项目源码 | 文件源码
def rotate_motor(duration,sleeptime):
   import RPi.GPIO as GPIO
   #import time

   servoPIN = 17
   GPIO.setmode(GPIO.BCM)
   GPIO.setup(servoPIN, GPIO.OUT)

   p = GPIO.PWM(servoPIN, 500) # GPIO 18 als PWM mit 50Hz
   p.start(2.5) # Initialisierung
   try:

      while duration > 0:
        p.ChangeDutyCycle(1)
    print 'motor running'+str(duration)
        time.sleep(sleeptime)
        duration -= 1
      p.stop()
      GPIO.cleanup()
   except KeyboardInterrupt:
      p.stop()
      GPIO.cleanup()
项目:10-4-a-robot    作者:gruener-campus-malchow    | 项目源码 | 文件源码
def rotate_motor(duration,sleeptime):
   import RPi.GPIO as GPIO
   #import time

   servoPIN = 17
   GPIO.setmode(GPIO.BCM)
   GPIO.setup(servoPIN, GPIO.OUT)

   p = GPIO.PWM(servoPIN, 500) # GPIO 18 als PWM mit 50Hz
   p.start(2.5) # Initialisierung
   try:

      while duration > 0:
        p.ChangeDutyCycle(1)
    print 'motor running'+str(duration)
        time.sleep(sleeptime)
        duration -= 1
      p.stop()
      GPIO.cleanup()
   except KeyboardInterrupt:
      p.stop()
      GPIO.cleanup()
项目:Webradio_v2    作者:Acer54    | 项目源码 | 文件源码
def __initGPIOs(self):
        #setup GPIO using Board numbering (pins, not GPIOs)
        GPIO.setwarnings(False)
        GPIO.cleanup()
        GPIO.setmode(GPIO.BOARD)

        #setup defined pins and event_detectors or outputs and initial states (initial is always 0, low)
        for pin in pins_in_use:
            if pins_in_use[pin][0] == GPIO.IN:
                if pin == 5:
                    GPIO.setup(pin, pins_in_use[pin][0], pull_up_down=GPIO.PUD_UP)
                else:
                    GPIO.setup(pin, pins_in_use[pin][0])
                GPIO.add_event_detect(pin, pins_in_use[pin][1], callback=self.shoutItOut, bouncetime=100)
                self.gpio_states.update({pin: 1})
            elif pins_in_use[pin][0] == GPIO.OUT:
                GPIO.setup(pin, pins_in_use[pin][0], initial=0)
项目:PiAlarm    作者:KyleKing    | 项目源码 | 文件源码
def stop():
    global _running
    _running = False
    cg.send("\nAlarm Cycles Finished\n")
    cg.ifttt('PiAlarm_SendText', {'value1': 'PiAlarm Completed'})

    # Cleanup tasks:
    all_off.run()
    GPIO.remove_event_detect(off_button)
    #
    # GPIO.cleanup()  # Removed to avoid interference with clock
    #
    # release_PWM(pin_shaker)
    # etc...
    # # Then stop pi-blaster for good measure:
    # stopPiB = "sudo kill $(ps aux | grep [b]laster | awk '{print $2}')"
    # subprocess.call(stopPiB, shell=True)
项目:Sample-Code    作者:meigrafd    | 项目源码 | 文件源码
def main():
    try:    
        GPIO.setmode(GPIO.BCM)
        GPIO.setup(START_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
        root = tk.Tk()
        root.overrideredirect(True)
        width, height = root.winfo_screenwidth(), root.winfo_screenheight()
        root.geometry('{0}x{1}+0+0'.format(width, height))
        root.wm_title('Stoppuhr')
        stopwatch = Stopwatch(LOG_FILENAME)
        GPIO.add_event_detect(START_PIN, GPIO.FALLING, stopwatch.start)
        stopwatch_ui = StopwatchUI(root, stopwatch)
        stopwatch_ui.pack()
        root.mainloop()
    finally:
        GPIO.cleanup()
项目:steppyr    作者:alangibson    | 项目源码 | 文件源码
def test_1(self):
    motor_steps = 200
    dir_pin = 8
    step_pin = 5
    enable_pin = 7

    GPIO.cleanup()

    stepper = StepDirDriver(dir_pin, step_pin, enable_pin)
    stepper.enable()

    async def run():
      await stepper.rotate(360)
      await stepper.move(-200)

    loop = asyncio.get_event_loop()
    # asyncio.ensure_future(stepper.run_forever())
    # asyncio.ensure_future(quickChange())
    try:
        loop.run_until_complete(run())
    finally:
        # stepper.stop()
        loop.close()
项目:steppyr    作者:alangibson    | 项目源码 | 文件源码
def main():
  stepper = Adafruit350ma()
  try:
    stepper.enable()
    while True:
      cmd = raw_input("Command, f or r:")
      direction = cmd[0]
      if direction == "f":
        while True:
          stepper.forward()
      else:
        while True:
          stepper.reverse()
  except Exception as e:
    print(e)
  finally:
    GPIO.cleanup()
项目:Raspberry-Pi-for-Python-Programmers-Cookbook-Second-Edition    作者:PacktPublishing    | 项目源码 | 文件源码
def main():
  try:
    gpioSetup()
    with SC.serPort(serName=SERNAME) as mySerialPort:
      mySerialPort.send("\r\n")
      mySerialPort.send("  GPIO Serial Control\r\n")
      mySerialPort.send("  -------------------\r\n")
      mySerialPort.send("  CMD PIN STATE "+
                        "[GPIO Pin# ON]\r\n")
      while running==True:
        print ("Waiting for command...")
        mySerialPort.send(">>")
        cmd = mySerialPort.receive(terminate="\r\n")
        response=handleCmd(cmd)
        mySerialPort.send(response)
      mySerialPort.send("  Finished!\r\n")
  except OSError:
    print ("Check selected port is valid: %s" %serName)
  except KeyboardInterrupt:
    print ("Finished")
  finally:
    GPIO.cleanup()
项目:kiota    作者:Morteo    | 项目源码 | 文件源码
def deinit(self):
        GPIO.cleanup()
项目:rpi-can-logger    作者:JonnoFTW    | 项目源码 | 文件源码
def shutdown():
    GPIO.cleanup()
项目:coliform-project    作者:uprm-research-resto    | 项目源码 | 文件源码
def shutdown(self):  # shuts down pins
        self.pwm.stop()
        GPIO.cleanup()
项目:raspi-photo-booth    作者:kriskbx    | 项目源码 | 文件源码
def loop():
    GPIO.add_event_detect(ButtonPin, GPIO.FALLING, callback=buttonPress)
    while True:
        pass

# When running directly, make sure to cleanup GPIO
项目:raspi-photo-booth    作者:kriskbx    | 项目源码 | 文件源码
def destroy():
    ledOff()
    beepOff()
    GPIO.cleanup()
项目:StratoBalloon    作者:delattreb    | 项目源码 | 文件源码
def __delete__(self, instance):
        if self.importlib is not None:
            self.cleanup()
项目:StratoBalloon    作者:delattreb    | 项目源码 | 文件源码
def cleanup(self):
        if self.importlib is not None:
            GPIO.cleanup()
项目:pibike    作者:johnjp15    | 项目源码 | 文件源码
def main():
    read_25 = GPIO.input(25)

    print(read_25)

    GPIO.cleanup()
###




#############################
项目:RaspberryPi-Robot    作者:timestocome    | 项目源码 | 文件源码
def hard_left(t=wheel_pulse):
    gpio.output(forward_right, gpio.HIGH)
    gpio.output(reverse_left, gpio.HIGH)

    sleep(t)
    gpio.output(forward_right, gpio.LOW)
    gpio.output(reverse_left, gpio.LOW)



##########################################################################
# cleanup
##########################################################################
项目:RaspberryPi-Robot    作者:timestocome    | 项目源码 | 文件源码
def cleanup():

    gpio.cleanup()




##########################################################################
# network
##########################################################################
项目:RaspberryPi-Robot    作者:timestocome    | 项目源码 | 文件源码
def cleanup():

    gpio.cleanup()

    pwm.set_pwm(channel, 0, servo_center)
    pwm = None





##########################################################################
# network
##########################################################################
项目:RaspberryPi-Robot    作者:timestocome    | 项目源码 | 文件源码
def cleanup(self):
        gpio.cleanup()



###################################################
# test class
项目:RaspberryPi-Robot    作者:timestocome    | 项目源码 | 文件源码
def cleanup(self):

        gpio.cleanup()

        self.pwm.set_pwm(0, 0, servo_center)
        self.pwm = None


##################################################################
# test
项目:RaspberryPi-Robot    作者:timestocome    | 项目源码 | 文件源码
def cleanup(self):
        gpio.cleanup()



###################################################
# test class
项目:photobooth    作者:eoghan-c    | 项目源码 | 文件源码
def tidy_up(self):
        # NOTE: This was the __del__ method, but seems more reliable to call explicitly
        print "Tidying up PhotoBooth instance"
        ButtonHandler().light_button_leds('slr', False) # Turn off all LEDs
        pygame.quit()  # End our pygame session
        GPIO.cleanup() # Make sure we properly reset the GPIO ports we've used before exiting

        # Restore monitor blanking (TODO can we store previous values?)
        os.system("setterm -blank 30 -powerdown 30")
项目:nfcmusik    作者:ehansis    | 项目源码 | 文件源码
def cleanup(self):
        """
        Calls stop_crypto() if needed and cleanups GPIO.
        """
        if self.authed:
            self.stop_crypto()
        GPIO.cleanup()
项目:pi-thrum    作者:arosspope    | 项目源码 | 文件源码
def cleanup(self):
        """
        Cleanup method which should be invoked before program exit
        """
        # Destroy pygame objects and de-init GPIO pins
        pygame.quit()
        GPIO.output(self.__LED, GPIO.LOW)
        GPIO.cleanup()
项目:Rpi-envMonitor    作者:conanwhf    | 项目源码 | 文件源码
def _GPIO_Power_UnRegist(pins):
    GPIO.cleanup(pins)
    return
项目:Rpi-envMonitor    作者:conanwhf    | 项目源码 | 文件源码
def __exit__(self):
        GPIO.cleanup()
项目:Rpi-envMonitor    作者:conanwhf    | 项目源码 | 文件源码
def __exit__(self):
        self.bus.close()
        GPIO.cleanup()
项目:Motion-Sensor    作者:Paco1994    | 项目源码 | 文件源码
def detect(run_event):
    isDetected = False
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(11, GPIO.IN) # Set GPIO 11 pin as input
    GPIO.setup(12,GPIO.OUT)
    GPIO.setup(16,GPIO.OUT)


    while run_event.is_set():
        i=GPIO.input(11)
        if i==0:         # if don't detect signal
            #print "\033[95mNobody detected.\033[0m",i
            GPIO.output(12,GPIO.HIGH)
            GPIO.output(16,GPIO.LOW)
            isDetected = False
            time.sleep(0.1)
        if i==1 and isDetected == False:       # if detect signal
            GPIO.output(16,GPIO.HIGH)
            GPIO.output(12,GPIO.LOW)
            print "\033[92mSomeone detected.\033[0m --> " + time.strftime("%H:%M:%S")
            bot.send_message(admin, "Someone detected -->   " + time.strftime("%H:%M:%S"))
            for i in range(1, 6, 4):
                print i
                name=video(3*i, frameRate) #One video of 3 seconds and another of 15
                if (name == "error"):
                    bot.send_message (admin, "The camera is busy now.")
                else:
                    bot.send_document(admin, open(name, 'rb'))
            #bot.send_document(admin, open('media/video/' + video(3), 'rb'))
            #bot.send_document(admin, open('media/video/' + video(15), 'rb'))
            print "ya"

            isDetected = True
    GPIO.cleanup()
项目:hydroponics    作者:tpudlik    | 项目源码 | 文件源码
def __exit__(self, type, value, traceback):
        GPIO.cleanup()
项目:hydroponics    作者:tpudlik    | 项目源码 | 文件源码
def __exit__(self, type, value, traceback):
        print "GPIO.cleanup()"
项目:AlexaPi    作者:alexa-pi    | 项目源码 | 文件源码
def setup(self):
        GPIO.setwarnings(False)
        GPIO.cleanup()
        GPIO.setmode(GPIO.BCM)

        super(RaspberrypiPlatform, self).setup()