This is a simple Linux kernel module that uses two GPIO buttons to control the blink frequency of an LED on a Raspberry Pi.
- Uses GPIO buttons to increase or decrease the LED blink frequency
- Implements a polling mechanism using a kernel thread
- Adjustable blink frequency
- Works on Raspberry Pi 2B (tested with GPIO18 for LED, GPIO23 and GPIO24 for buttons)
- Raspberry Pi 2B (or similar device with GPIO support)
- Linux kernel with module support
- Build tools (
make,gcc,linux-headerspackage for your kernel)
git clone https://github.com/galitianu/two_button_blink.git
cd two-button-led-drivermakesudo insmod two_button_blink.kodmesg | grep "two_button_blink"- Press the increment button (GPIO23) to increase blink frequency
- Press the decrement button (GPIO24) to decrease blink frequency
To see frequency changes being registered in real time, use sudo dmesg -wH
To remove the module, run:
sudo rmmod two_button_blinkThis project is licensed under the GPLv2 license.
Andrei Galitianu