driver_mife.py 718 Bytes
# -*- coding: utf-8 -*-
import RPi.GPIO as io
import time

def do_led_green(pin_cmd_led_bcm=18, onoff=1):
   """

Exemple:

import driver_mife ; driver_mife.do_led_green(18,1)
"""

   io.setwarnings(False)
   io.setmode(io.BCM) #set up GPIO using BCM numbering
   io.setup(pin_cmd_led_bcm,io.OUT) # make pin an output (=arduino 2 open)

   io.output(pin_cmd_led_bcm,onoff)
   return onoff

def do_led_red(pin_cmd_led_bcm=17, onoff=1):
   """

Exemple:

import driver_mife ; driver_mife.do_led_red(17,1)
"""

   io.setwarnings(False)
   io.setmode(io.BCM) #set up GPIO using BCM numbering
   io.setup(pin_cmd_led_bcm,io.OUT) # make pin an output (=arduino 3 open)

   io.output(pin_cmd_led_bcm,onoff)
   return onoff