5 You need to install the [wiringPi library](http://wiringpi.com/). Refer to [download and install](http://wiringpi.com/download-and-install/) manual.
9 Link to the library must be passed to nit compiler:
11 nitc myprogram.nit --cc-lib-name wiringPi
15 You first need to initialize the wiringPi library using a setup methods.
19 * `wiringPi_setup`: This initialises wiringPi and assumes that the calling program is going to be using the wiringPi pin numbering scheme;
20 * `wiringPi_setup_gpio`: Same as wiringPi_setup, however it allows the calling programs to use the Broadcom GPIO pin numbers directly with no re-mapping;
21 * `wiringPi_setup_phys`: Identical to wiringPi_setup, however it allows the calling programs to use the physical pin numbers on the P1 connector only;
22 * `wiringPi_setup_sys`: This initialises wiringPi but uses the /sys/class/gpio interface rather than accessing the hardware directly;
26 # init wiringPi lib with gpio output
29 Then you can refer to a GPIO Pin using its id:
31 var pin = new RPIPin(23)
33 Before read or write a value on a pin you need to set its mode.
42 Note that only wiringPi pin 1 (BCM\_GPIO 18) supports PWM output and only wiringPi pin 7 (BCM\_GPIO 4) supports CLOCK output modes.
44 pin.mode(new RPIPinMode.output_mode)
46 You can then `write` or `read` a value from the pin:
53 The wiringPi library is released under [GNU LGPLv3](http://www.gnu.org/copyleft/lesser.html) licence.