This code is used to blink an LED connected to a GPIO pin.
This code requires the onoff
package to be installed.
The LED is connected to GPIO pin 4, and is set to output mode.
The blinkLED
function is called every 250ms, which turns the LED on and off. The LED blinking can be stopped by calling the endBlink
function. This will stop the blinking and turn the LED off.