Startup script startpwm
authorArjen Baart <arjen@andromeda.nl>
Sun, 3 May 2020 14:41:51 +0000 (16:41 +0200)
committerArjen Baart <arjen@andromeda.nl>
Sun, 3 May 2020 14:41:51 +0000 (16:41 +0200)
src/startpwm [new file with mode: 0755]

diff --git a/src/startpwm b/src/startpwm
new file mode 100755 (executable)
index 0000000..9bba7ca
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+#
+#  Start the pwm generator with real time priority.
+#
+
+PATH=$PATH:/usr/local/bin
+
+# Initialize the shared memory segment.
+
+lightcontrol -r 0 -g 0 -b 0 -w 0
+
+chrt -f  50 pwm &
+
+
+#  Create a sequence of light colors to test if the generator is working
+#  The sequence is red - green - blue - white.
+
+
+lightcontrol -r 100 -g 0 -b 0 -w 0
+sleep 2
+lightcontrol -r 0 -g 100 -b 0 -w 0
+sleep 2
+lightcontrol -r 0 -g 0 -b 100 -w 0
+sleep 2
+lightcontrol -r 0 -g 0 -b 0 -w 100
+sleep 2
+lightcontrol -r 0 -g 0 -b 0 -w 0