From 1b6076d3201fc4e1c6ba77e570f7b4ade84f19da Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Mon, 19 Sep 2011 23:00:05 +0000 Subject: [PATCH] conrad rsl366t funksteckdosen --- rf433ctl/rf433ctl.pde | 76 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/rf433ctl/rf433ctl.pde b/rf433ctl/rf433ctl.pde index 7212b89..b083a91 100644 --- a/rf433ctl/rf433ctl.pde +++ b/rf433ctl/rf433ctl.pde @@ -186,8 +186,17 @@ byte volatile frame_finished = 1; #define BLACK_D3_ON 38 #define BLACK_D3_OFF 39 +#define RSL336T_INDEX(SW,BT,OFF) 40+(2*4*SW)+(2*BT)+OFF -const word_t words[] = { + +#define PWM_01 PWM0,PWM1 +#define PWM_00 PWM0,PWM0 +#define RSL336T_SWBT_1 PWM_00,PWM_01,PWM_01,PWM_01 +#define RSL336T_SWBT_2 PWM_01,PWM_00,PWM_01,PWM_01 +#define RSL336T_SWBT_3 PWM_01,PWM_01,PWM_00,PWM_01 +#define RSL336T_SWBT_4 PWM_01,PWM_01,PWM_01,PWM_00 + +const word_t words[] = { { ZERO, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC, WORD_END, WORD_END,WORD_END}, // A1_ON { ZERO, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC, WORD_END, WORD_END,WORD_END}, // A1_OFF { ZERO, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC, WORD_END, WORD_END,WORD_END }, // A2_ON @@ -234,7 +243,43 @@ const word_t words[] = { {PWM0,PWM1,PWM0,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM1,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM1,PWM1,PWM0,PWM0,PWM0, PWM_PAUSE, WORD_END}, // BLACK_D2_ON {PWM0,PWM1,PWM0,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM1,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM1,PWM1,PWM0, PWM_PAUSE, WORD_END}, // BLACK_D2_OFF {PWM0,PWM1,PWM0,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM1,PWM1,PWM0,PWM0,PWM0, PWM_PAUSE, WORD_END}, // BLACK_D3_ON -{PWM0,PWM1,PWM0,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM1,PWM1,PWM0, PWM_PAUSE, WORD_END} // BLACK_D3_OFF +{PWM0,PWM1,PWM0,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM1,PWM0,PWM1,PWM1,PWM1,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM0,PWM1,PWM1,PWM0, PWM_PAUSE, WORD_END}, // BLACK_D3_OFF + +{RSL336T_SWBT_1,RSL336T_SWBT_1,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_I_1_ON +{RSL336T_SWBT_1,RSL336T_SWBT_1,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_I_1_OFF +{RSL336T_SWBT_1,RSL336T_SWBT_2,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_I_2_ON +{RSL336T_SWBT_1,RSL336T_SWBT_2,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_I_2_OFF +{RSL336T_SWBT_1,RSL336T_SWBT_3,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_I_3_ON +{RSL336T_SWBT_1,RSL336T_SWBT_3,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_I_3_OFF +{RSL336T_SWBT_1,RSL336T_SWBT_4,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_I_4_ON +{RSL336T_SWBT_1,RSL336T_SWBT_4,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_I_4_OFF + +{RSL336T_SWBT_2,RSL336T_SWBT_1,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_II_1_ON +{RSL336T_SWBT_2,RSL336T_SWBT_1,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_II_1_OFF +{RSL336T_SWBT_2,RSL336T_SWBT_2,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_II_2_ON +{RSL336T_SWBT_2,RSL336T_SWBT_2,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_II_2_OFF +{RSL336T_SWBT_2,RSL336T_SWBT_3,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_II_3_ON +{RSL336T_SWBT_2,RSL336T_SWBT_3,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_II_3_OFF +{RSL336T_SWBT_2,RSL336T_SWBT_4,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_II_4_ON +{RSL336T_SWBT_2,RSL336T_SWBT_4,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_II_4_OFF + +{RSL336T_SWBT_3,RSL336T_SWBT_1,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_III_1_ON +{RSL336T_SWBT_3,RSL336T_SWBT_1,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_III_1_OFF +{RSL336T_SWBT_3,RSL336T_SWBT_2,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_III_2_ON +{RSL336T_SWBT_3,RSL336T_SWBT_2,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_III_2_OFF +{RSL336T_SWBT_3,RSL336T_SWBT_3,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_III_3_ON +{RSL336T_SWBT_3,RSL336T_SWBT_3,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_III_3_OFF +{RSL336T_SWBT_3,RSL336T_SWBT_4,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_III_4_ON +{RSL336T_SWBT_3,RSL336T_SWBT_4,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_III_4_OFF + +{RSL336T_SWBT_4,RSL336T_SWBT_1,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_IV_1_ON +{RSL336T_SWBT_4,RSL336T_SWBT_1,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_IV_1_OFF +{RSL336T_SWBT_4,RSL336T_SWBT_2,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_IV_2_ON +{RSL336T_SWBT_4,RSL336T_SWBT_2,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_IV_2_OFF +{RSL336T_SWBT_4,RSL336T_SWBT_3,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_IV_3_ON +{RSL336T_SWBT_4,RSL336T_SWBT_3,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_IV_3_OFF +{RSL336T_SWBT_4,RSL336T_SWBT_4,PWM_01,PWM_01,PWM_01,PWM_01,PWM0, PWM_PAUSE, WORD_END}, // RSL366T_IV_4_ON +{RSL336T_SWBT_4,RSL336T_SWBT_4,PWM_01,PWM_01,PWM_01,PWM_00,PWM0, PWM_PAUSE, WORD_END} // RSL366T_IV_4_OFF }; @@ -671,7 +716,32 @@ void loop() send_frame(words[BLACK_D3_ON]); else if(command == 't') send_frame(words[BLACK_D3_OFF]); - + + else if (command == 'U') + send_frame(words[RSL336T_INDEX(0,0,0)]); + else if (command == 'u') + send_frame(words[RSL336T_INDEX(0,0,1)]); + else if (command == 'V') + send_frame(words[RSL336T_INDEX(0,1,0)]); + else if (command == 'v') + send_frame(words[RSL336T_INDEX(0,1,1)]); + else if (command == 'W') + send_frame(words[RSL336T_INDEX(0,2,0)]); + else if (command == 'w') + send_frame(words[RSL336T_INDEX(0,2,1)]); + else if (command == 'X') + send_frame(words[RSL336T_INDEX(0,3,0)]); + else if (command == 'x') + send_frame(words[RSL336T_INDEX(0,3,1)]); + else if (command == 'Y') + send_frame(words[RSL336T_INDEX(1,0,0)]); + else if (command == 'y') + send_frame(words[RSL336T_INDEX(1,0,1)]); + else if (command == 'Z') + send_frame(words[RSL336T_INDEX(1,1,0)]); + else if (command == 'z') + send_frame(words[RSL336T_INDEX(1,1,1)]); + else if(command == '*') { sensorEchoCommand(command); -- 1.7.10.4