aboutsummaryrefslogtreecommitdiff
path: root/recipes-demo/de10-nano-gpio-apps/files/toggle_fpga_leds.sh
blob: 8564a3054aebc2e5b6bd4705d1e8e502283fb081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

LEDS="
fpga_led0
fpga_led1
fpga_led2
fpga_led3
fpga_led4
fpga_led5
fpga_led6
fpga_led7
"

# turn off all leds
for NEXT_LED in ${LEDS}
do
	echo "none" > /sys/class/leds/${NEXT_LED}/trigger
	echo "0" > /sys/class/leds/${NEXT_LED}/brightness
done

# toggle the leds individually
for NEXT_LED in ${LEDS} ${LEDS}
do
	cat /sys/class/leds/${NEXT_LED}/brightness | \
		tr '01' '10' > /sys/class/leds/${NEXT_LED}/brightness
	usleep 125000
done