Raspberry Pi GPIO Library
0.3
Library allowing for control of the Raspberry Pi's GPIO pins.
|
To use this library you must:
gcc -I/path/to/RaspberryPi-GPIO-C/include/ -o <outputfile> \
<input_list>
gcc -I/path/to/RaspberryPi-GPIO-C/include/ -o <output_file> \
<input_files>
</path/to/RaspberryPi-GPIO-C/library/libRpiGpio.a>
Or you can add the directoy which the library resides to the list of directories the linker checks for library files. The library path is specified with -L<path>. You then need to tell GCC that you want to use this particular library. This is done with -l<lib-name>. The lib_name is name of the library with the preceding "lib" and proceeding ".a" removed. libRpiGpio.a = RpiGpio
gcc -I/path/to/RaspberryPi-GPIO-C/include/ \
-L/path/to/RaspberryPi-GPIO-C/library \
-o outputfile <input_file> \
-lRpiGpio
output
. You can now change the state of the pin with gpioSetPin(), passing in the desired pin number and either high
or low
.input
. You can now read the state of the pin with gpioReadPin(), passing in the desired pin number as well a pointer to a type eState which will hold the current state of the pin after the function returns.