Blame view

src/utils/plc/guitalens_observatory/driver_mife.py 718 Bytes
ac31ddb1   Alain Klotz   New celme documen...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- 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