From: Arjen Baart Date: Thu, 2 Jan 2020 21:28:27 +0000 (+0100) Subject: Adapted to new hardware X-Git-Url: http://www.andromeda.nl/gitweb/?a=commitdiff_plain;h=2851c2b3d0672e2478e56606c1524ea8bd10937c;p=wakeup.git Adapted to new hardware --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fccb39b --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +Makefile.in +aclocal.m4 +autom4te.cache +compile +config.h.in +configure +depcomp +install-sh +missing +test-driver diff --git a/src/pwm.c b/src/pwm.c index 403a11d..9aae3e5 100644 --- 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) { diff --git a/test/colorsequence b/test/colorsequence index 76221e0..e4b535b 100755 --- a/test/colorsequence +++ b/test/colorsequence @@ -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 diff --git a/test/flash.py b/test/flash.py index bcb2c52..0d072b6 100644 --- a/test/flash.py +++ b/test/flash.py @@ -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 index 0000000..a7c013e --- /dev/null +++ b/test/wakeupsequence @@ -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 +