code: def encode_pin(self, pin, matrix=None):
          
          if matrix is None:
              _, matrix = self.read_pin()
          return "".join([str(matrix.index(p) + 1) for p in pin])
docs: Transform correct PIN according to the displayed matrix.