]> oss.titaniummirror.com Git - rgblamp.git/log
rgblamp.git
12 years agoAlways fade between colors
R. Steve McKown [Wed, 7 Dec 2011 02:52:55 +0000 (19:52 -0700)]
Always fade between colors

The A and B positions now act exactly the same, except B engages auto-off.

12 years agoImplement auto-off
R. Steve McKown [Wed, 7 Dec 2011 02:09:17 +0000 (19:09 -0700)]
Implement auto-off

After 5 hours, approximately, the lamp will automatically turn off.
Toggle the rocker to wake it back up.  An auto-wake feature will
be added later.

12 years agoUpdate buttons_sleep() for auto-off restart case
R. Steve McKown [Wed, 7 Dec 2011 02:07:47 +0000 (19:07 -0700)]
Update buttons_sleep() for auto-off restart case

buttons_sleep() now first sleeps until the rocker switch is turned off
before then sleeping until it is turned on.  This allows the function to
be used for the auto-off case, where the lamp must stay in auto-off when
the rocker switch is still in position B.  To wake from auto-off manually,
one simply turns the rocker off then back to either position A or B.

12 years agoAdd timer.h to timer.c
R. Steve McKown [Wed, 7 Dec 2011 02:07:10 +0000 (19:07 -0700)]
Add timer.h to timer.c

timer_xxx() functions need access to timer_cwait() inline macro.

12 years agoDon't use the white LED in random mode
R. Steve McKown [Wed, 7 Dec 2011 00:23:25 +0000 (17:23 -0700)]
Don't use the white LED in random mode

The white LED tends to wash out other colors, so don't use it.  The
CREE MC-E LED assembly makes a pretty good white using R+G+B.

12 years agoUpdate mplabx files
R. Steve McKown [Wed, 7 Dec 2011 00:17:50 +0000 (17:17 -0700)]
Update mplabx files

12 years agoClock loop start to loop start using Timer 0
R. Steve McKown [Wed, 7 Dec 2011 00:16:33 +0000 (17:16 -0700)]
Clock loop start to loop start using Timer 0

Timer 0 is configured to overflow every 32 msec, which is the period we
wait when driving the main control loop.  Once a loop iteration has
completed its processing, it calls timer_owait() to wait on the next
overflow.

12 years agoRun at 2 MHz
R. Steve McKown [Tue, 6 Dec 2011 18:43:40 +0000 (11:43 -0700)]
Run at 2 MHz

* PWM at 1.95 kHz
* 25 ms max loop processing time, out of a desired 32 ms.

12 years agomplabx file updates
R. Steve McKown [Tue, 6 Dec 2011 18:40:25 +0000 (11:40 -0700)]
mplabx file updates

12 years agoAdd debug pin
R. Steve McKown [Tue, 6 Dec 2011 18:38:34 +0000 (11:38 -0700)]
Add debug pin

* Debug on pin 1 of DIP18 package, RA2.
* Set pin high when processing in the loop.  Low during wait or sleep.

At 4 MHz, we see that processing within the loop is at most 12 ms, and
we have a loop period constraint of 32 ms.  We could run at 2 MHz too...

12 years agoRun at Fosc = 4MHz
R. Steve McKown [Tue, 6 Dec 2011 18:36:13 +0000 (11:36 -0700)]
Run at Fosc = 4MHz

* Run on internal oscillator at 4 MHz
* Get rid of the RUNAT32MHz definition
* Adjust PWM for ~ 1 kHz frequency, at Fosc = 4 MHz
* Loop processing <= 12 ms, out of a period of 32 ms

12 years agounused_init() properly configures unused pins
R. Steve McKown [Tue, 6 Dec 2011 16:34:52 +0000 (09:34 -0700)]
unused_init() properly configures unused pins

PortA unused pins are set as output high.
PortB can have unused pins as input with weak pull-ups enabled.

12 years agoUse internal uc pull-ups for IO pins.
R. Steve McKown [Tue, 6 Dec 2011 16:30:47 +0000 (09:30 -0700)]
Use internal uc pull-ups for IO pins.

This allows removal of the three external pull-up resistors in the circuit.

12 years agoHave 4 speed modes
R. Steve McKown [Tue, 6 Dec 2011 02:50:27 +0000 (19:50 -0700)]
Have 4 speed modes

12 years agoUse pushbutton rising edge for state change
R. Steve McKown [Tue, 6 Dec 2011 02:39:16 +0000 (19:39 -0700)]
Use pushbutton rising edge for state change

12 years agoTiming as const arrays
R. Steve McKown [Tue, 6 Dec 2011 02:18:15 +0000 (19:18 -0700)]
Timing as const arrays

For some reason, holding the pushbutton goofs up things...

12 years agoFix fading
R. Steve McKown [Tue, 6 Dec 2011 01:48:06 +0000 (18:48 -0700)]
Fix fading

12 years agofade is working
R. Steve McKown [Tue, 6 Dec 2011 00:09:22 +0000 (17:09 -0700)]
fade is working

12 years agoFading isn't working
R. Steve McKown [Mon, 5 Dec 2011 00:03:47 +0000 (17:03 -0700)]
Fading isn't working

12 years agoMinor changes on startup
R. Steve McKown [Sun, 4 Dec 2011 23:41:28 +0000 (16:41 -0700)]
Minor changes on startup

12 years agoCloser to a full featured setup
R. Steve McKown [Sun, 4 Dec 2011 22:57:55 +0000 (15:57 -0700)]
Closer to a full featured setup

Rocker switch is power switch.

* Off: lamp is off, PWM off, CPU in sleep
* On (right): Random time to fade between colors, with a random time
  staying in each color.
* Off (left): No fade between colors, with a random time in each color.

The push button speeds up fade and incolor times by a factor of 8.

12 years ago4 channel PWM with sample color changing
R. Steve McKown [Sat, 3 Dec 2011 02:55:50 +0000 (19:55 -0700)]
4 channel PWM with sample color changing

12 years agoFix comments about port assignments
R. Steve McKown [Thu, 1 Dec 2011 19:04:40 +0000 (12:04 -0700)]
Fix comments about port assignments

12 years agoAlter PWM in small increments
R. Steve McKown [Wed, 30 Nov 2011 23:49:33 +0000 (16:49 -0700)]
Alter PWM in small increments

* Use unsigned char, as unsigned short is a 16-bit value
* Increment and decrement PWM value by 1 instead of 16
* Alternate fixed LED state based on increasing/decreasing PWM duty
* Ignore /funclist file

12 years agoInitial commit
R. Steve McKown [Wed, 30 Nov 2011 23:37:12 +0000 (16:37 -0700)]
Initial commit