Let's look at a couple of ways of controlling the Raspberry Pi's GPIO pins using the C programming language, and the Low Voltage Labs traffic light LEDs.
Wiring Pi is a well established library for handling GPIO interactions. Full details in this Medium article.
Here's my example code and documentation.
Using this method requires no external libraries, we just need to write code to manipulate files on the Pi's filesystem.
Here's my example code and documentation.
- The code samples page at elinux.org has a wealth of information about GPIO programming for the Raspberry Pi.
- resin.io have also published a good summary of options for working with GPIO.