Handle interrupt generated on a GPIO


I recently bought the Beaglebone Black.
Now I want to write a simple code that does something when voltage level is changed on a PIN.

Let’s say that value of GPIO1_08 is 0V. When value changes to 3.3V I want my code to be automatically
aware of that (interrupted).

Could you tell me what I need to do?

Do I need to set some values on the GPIO1_08 so that the PIN “informs” my code when its value is changed?

In my code, I don’t want to stay in place and wait for the PIN. I want that the PIN send indication asynchronously.

Thanks in advance!