How to write a sketch for using GPIO

Hi everyone! Do anyone know, how to write a sketch for using GPIO or maybe someone has an example?

HI: you can to check it. (Sample code : bpi-w2-gpio40-led.sh)