You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
828 B
36 lines
828 B
#!/bin/bash
|
|
|
|
trap ctrl_c INT
|
|
|
|
delay=0.05
|
|
|
|
function ctrl_c() {
|
|
echo "0" > /sys/class/gpio/gpio17/value
|
|
echo "0" > /sys/class/gpio/gpio27/value
|
|
echo "0" > /sys/class/gpio/gpio23/value
|
|
exit 0
|
|
}
|
|
|
|
# RED
|
|
echo "17" > /sys/class/gpio/export 2>/dev/null
|
|
echo "out" > /sys/class/gpio/gpio17/direction
|
|
# GREEN
|
|
echo "27" > /sys/class/gpio/export 2>/dev/null
|
|
echo "out" > /sys/class/gpio/gpio27/direction
|
|
# BLUE
|
|
echo "23" > /sys/class/gpio/export 2>/dev/null
|
|
echo "out" > /sys/class/gpio/gpio23/direction
|
|
|
|
while :
|
|
do
|
|
echo "1" > /sys/class/gpio/gpio17/value
|
|
sleep $delay
|
|
echo "0" > /sys/class/gpio/gpio17/value
|
|
echo "1" > /sys/class/gpio/gpio27/value
|
|
sleep $delay
|
|
echo "0" > /sys/class/gpio/gpio27/value
|
|
echo "1" > /sys/class/gpio/gpio23/value
|
|
sleep $delay
|
|
echo "0" > /sys/class/gpio/gpio23/value
|
|
done
|