(data, bits, verbose=False)
return level
Returns sensor level value from data using sensor bit mask in micro volts (uV).
Returns sensor level value from data using sensor bit mask in micro volts (uV).
Returns sensor level value from data using sensor bit mask in micro volts ( uV ) .
def get_level_16(data, bits, verbose=False):
    """
    Returns sensor level value from data using sensor bit mask in micro volts (uV).
    """
    if verbose:
        return detailed_get_level(data, bits)
    level = 0
    for i in range(15, -1, -1):
        level <<= 1
        b = (bits[i] // 8) + 1
        o = bits[i] % 8
        if sys.version_info >= (3, 0):
            level |= (data[b] >> o) & 1
        else:
            level |= (ord(data[b]) >> o) & 1
    return level
def get_level_16 ( data , bits , verbose = False ) : if verbose : return detailed_get_level ( data , bits ) level = 0 for i in range ( 15 , - 1 , - 1 ) : level <<= 1 b = ( bits [ i ] // 8 ) + 1 o = bits [ i ] % 8 if sys . version_info >= ( 3 , 0 ) : level |= ( data [ b ] >> o ) & 1 else : level |= ( ord ( data [ b ] ) >> o ) & 1 return level