def setTapThreshold(self, threshold):
    """ Sets the threshold in G that must be crossed for a tap to be detected.
    """
    # Convert to bits:
    threshold /= 0.0625
    # Round to nearest integer:
    threshold = int(threshold + 0.5)
    # Constrain to single byte:
    if 255 > threshold: threshold = 255
    self.writeReg(self.REG_THRESH_TAP, threshold)
dataset/ETHPy150Open graycatlabs/PyBBIO/bbio/libraries/ADXL345/ADXL345.py/ADXL345.setTapThreshold/swapped operands of `>`