code: func OpenPin(n int, mode Mode) (Pin, error) {
  	// export this pin to create the virtual files on the system
  	pinBase, err := expose(n)
  	if err != nil {
  		return nil, err
  	}
  	value, err := os.OpenFile(filepath.Join(pinBase, "value"), os.O_RDWR, 0600)
  	if err != nil {
  		return nil, err
  	}
  	p := &pin{
  		number:    n,
  		modePath:  filepath.Join(pinBase, "direction"),
  		edgePath:  filepath.Join(pinBase, "edge"),
  		valueFile: value,
  		initial:   true,
  	}
  	if err := p.setMode(mode); err != nil {
  		p.Close()
  		return nil, err
  	}
  	return p, nil
  }
docs: // OpenPin exports the pin, creating the virtual files necessary for interacting with the pin.
  // It also sets the mode for the pin, making it ready for use.