Adapted to new hardware
authorArjen Baart <arjen@andromeda.nl>
Thu, 2 Jan 2020 21:28:27 +0000 (22:28 +0100)
committerArjen Baart <arjen@andromeda.nl>
Thu, 2 Jan 2020 21:28:27 +0000 (22:28 +0100)
.gitignore [new file with mode: 0644]
src/pwm.c
test/colorsequence
test/flash.py
test/wakeupsequence [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..fccb39b
--- /dev/null
@@ -0,0 +1,10 @@
+Makefile.in
+aclocal.m4
+autom4te.cache
+compile
+config.h.in
+configure
+depcomp
+install-sh
+missing
+test-driver
index 403a11d..9aae3e5 100644 (file)
--- a/src/pwm.c
+++ b/src/pwm.c
@@ -47,10 +47,10 @@ void setup_io();
 
 /*  GPIO pin assignments */
 
-#define OUTPUT_RED    2
-#define OUTPUT_GREEN  3
-#define OUTPUT_BLUE   4
-#define OUTPUT_WHITE 15
+#define OUTPUT_RED    3
+#define OUTPUT_GREEN 14
+#define OUTPUT_BLUE  15
+#define OUTPUT_WHITE  4
 
 
 int main()
@@ -105,14 +105,16 @@ int main()
 
    signals = (struct pwm *)shm;
 
+/*
    for (i=0; i < 5; i++)
    {
       printf("Interval = %d, output = %d\n", signals[i].interval, signals[i].output);
    }
+*/
 
-   int repeat = 2000;
+   int repeat = 80000;
 
-   while (repeat--)
+   while (1)
    {
       if (signals->interval != 0)
       {
index 76221e0..e4b535b 100755 (executable)
@@ -3,9 +3,8 @@
 #  Create a sequence of light colors for test purposes.
 #  The sequence is red - green - blue - white.
 
-PATH=$PATH:.
+PATH=$PATH:../src
 
-pwm-sysfs &
 
 lightcontrol -r 100 -g 0 -b 0 -w 0
 sleep 2
index bcb2c52..0d072b6 100644 (file)
@@ -1,10 +1,10 @@
 import RPi.GPIO as GPIO
 import time
 GPIO.setmode(GPIO.BCM)
-led_R=2
-led_G=3
-led_B=4
-led_W=18
+led_R=3
+led_G=14
+led_B=15
+led_W=4
 led=led_W
 counter = 0
 GPIO.setup(led_R,GPIO.OUT)
@@ -12,6 +12,7 @@ GPIO.setup(led_G,GPIO.OUT)
 GPIO.setup(led_B,GPIO.OUT)
 GPIO.setup(led_W,GPIO.OUT)
 while True:
+   print hex(counter)
    if (counter & 1) == 1:
       GPIO.output(led_R,1)
    if counter & 2 == 2:
diff --git a/test/wakeupsequence b/test/wakeupsequence
new file mode 100755 (executable)
index 0000000..a7c013e
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+#  Create a sequence of light colors for test purposes.
+#  The sequence is red - green - blue - white.
+
+PATH=$PATH:../src
+export LD_LIBRARY_PATH=/usr/local/lib
+
+FADETIME=200
+
+lightcontrol -r 100 -f $FADETIME
+lightcontrol -g 100 -f $FADETIME
+lightcontrol -w 100 -f $FADETIME
+sleep 600
+lightcontrol -r 0 -g 0 -w 0 -f $FADETIME
+