<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_bit(self, registeraddress, functioncode=2):
 """Read one bit from the slave. Args: * registeraddress (int):
 The slave register address (use decimal numbers, not hex). * functioncode (int):
 Modbus function code. Can be 1 or 2. Returns: The bit value 0 or 1 (int). Raises: ValueError, TypeError, IOError """

        _checkFunctioncode(functioncode, [1, 2])
        return self._genericCommand(functioncode, registeraddress)