Beispiel #1
0
def get_pin_bit_mask(pin_number):
    """Translates a pin number to pin bit mask. First pin is pin1 (not pin0).
    pin3 = 0b00000100
    pin4 = 0b00001000

    TODO: throw and exception if the pin number is out of range
    #return 2**(pin_number-1)
    return 1 << (pin_number - 1) # shifting makes more sense
    """
    return pfio.get_pin_bit_mask(pin_number)
Beispiel #2
0
def get_pin_bit_mask(pin_number):
    """Translates a pin number to pin bit mask."""
    return pfio.get_pin_bit_mask(pin_number)