Video example that may be of use here; using PS GPIO:
There are other ways to do this depending on what you need, and your IP.
Cathal