There is a very helpful page here for WiringNP in C. How about another page doing it in Python.
http://wiki.friendlyarm.com/wiki/index. ... ing_with_C