https://github.com/simonprickett/cpitrafficlights
Experiments with a Raspberry Pi, Low Voltage Labs Traffic Light LEDs and the C Programming Language.
https://github.com/simonprickett/cpitrafficlights
c gpio gpio-pins low-voltage-labs raspberry-pi raspberry-pi-3
Last synced: 7 months ago
JSON representation
Experiments with a Raspberry Pi, Low Voltage Labs Traffic Light LEDs and the C Programming Language.
- Host: GitHub
- URL: https://github.com/simonprickett/cpitrafficlights
- Owner: simonprickett
- License: mit
- Created: 2018-08-03T05:40:17.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-07T14:42:27.000Z (about 7 years ago)
- Last Synced: 2025-03-19T23:53:19.966Z (7 months ago)
- Topics: c, gpio, gpio-pins, low-voltage-labs, raspberry-pi, raspberry-pi-3
- Language: C
- Homepage: https://simonprickett.dev/
- Size: 34.2 KB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Experiments with Low Voltage Labs Traffic Lights on Raspberry Pi in C
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](http://lowvoltagelabs.com/products/pi-traffic/).
# Wiring Pi Method
[Wiring Pi](http://wiringpi.com/) is a well established library for handling GPIO interactions. Full details in [this Medium article](https://medium.com/@simon_prickett/gpio-access-in-c-with-raspberry-pi-traffic-lights-6b982e197d45).
[Here's my example code and documentation](wiringpi/).
# sysfs Method
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](sysfs/).
# Resources
* The [code samples page](https://elinux.org/RPi_GPIO_Code_Samples) 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](https://docs.resin.io/learn/develop/hardware/gpio/#raspberry-pi) for working with GPIO.