From 5484ea8ad5a737fc7dbf2e4c9836c4571f96532f Mon Sep 17 00:00:00 2001 From: simimeie Date: Thu, 1 Jul 2010 23:56:19 +0000 Subject: [PATCH] some more colors on the remote interpreted --- main.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 5e9fb22..b94bc1d 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.4 2010/06/30 19:39:28 simimeie Exp $ +/* $Id: main.c,v 1.5 2010/07/01 23:56:19 simimeie Exp $ * Main file for the HaWo moodlight. * This is the main file that glues it all together. It also contains all * functionality that is too small to require an extra file. @@ -97,6 +97,12 @@ int main(void) if (ledpwm_bri > 0) { ledpwm_bri--; } } break; + case 0x02: /* "Off" */ + ledpwm_bri = 0; + break; + case 0x03: /* "On" */ + ledpwm_bri = 128; + break; case 0x04: /* Red */ if (irstate == IRSTATE_RED) { ledpwm_re = 0xff; ledpwm_gr = 0; ledpwm_bl = 0; @@ -133,18 +139,34 @@ int main(void) ledpwm_re = 0xff; ledpwm_gr = 0x40; ledpwm_bl = 0x00; irstate = 0; break; + case 0x09: /* greenish cyan */ + ledpwm_re = 0x00; ledpwm_gr = 0xff; ledpwm_bl = 0x80; + irstate = 0; + break; case 0x0c: /* orange */ ledpwm_re = 0xff; ledpwm_gr = 0x80; ledpwm_bl = 0x00; irstate = 0; break; + case 0x0d: /* cyan */ + ledpwm_re = 0x00; ledpwm_gr = 0xff; ledpwm_bl = 0xff; + irstate = 0; + break; case 0x10: /* bright orange */ ledpwm_re = 0xff; ledpwm_gr = 0xc0; ledpwm_bl = 0x00; irstate = 0; break; + case 0x11: /* blueish cyan */ + ledpwm_re = 0x00; ledpwm_gr = 0xa0; ledpwm_bl = 0xff; + irstate = 0; + break; case 0x14: /* yellow */ ledpwm_re = 0xff; ledpwm_gr = 0xff; ledpwm_bl = 0x00; irstate = 0; break; + case 0x15: /* blueerish cyan */ + ledpwm_re = 0x00; ledpwm_gr = 0x60; ledpwm_bl = 0xff; + irstate = 0; + break; }; ledpwm_setled(LEDPWM_REDLED, (((uint16_t)ledpwm_re * ledpwm_bri) / 255)); ledpwm_setled(LEDPWM_GREENLED, (((uint16_t)ledpwm_gr * ledpwm_bri) / 255)); -- 2.25.1