add BRIGHT/DIM commands support

This commit is contained in:
Michael Hurni
2014-10-13 19:48:09 +02:00
parent fd9d988bc6
commit 7b272c80ed
3 changed files with 19 additions and 2 deletions
+9
View File
@@ -16,3 +16,12 @@ RFXmeter KEYWORD2
RFXsensor KEYWORD2
x10Switch KEYWORD2
x10Security KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################
ON LITERAL1
OFF LITERAL1
BRIGHT LITERAL1
DIM LITERAL1
+5 -2
View File
@@ -178,8 +178,11 @@ void x10rf::x10Switch(char house_code, uint8_t unit_code, uint8_t command){
x10buff[0] = x10buff[0] << 4; // House code goes into the upper nibble
switch(command) {
case 0: x10buff[2] = (x10buff[2] | 0x20); break;
case 1: x10buff[2] = (x10buff[2] & 0x20); break;
case ON:
case OFF:
case BRIGHT:
case DIM:
x10buff[2] = command; break;
}
// Set unit number
unit_code = unit_code - 1;
+5
View File
@@ -15,6 +15,11 @@ Tested on a TI Stellarpad (LM4F120H5QR) and Energia 0101E0010. This should also
#ifndef x10rf_h
#define x10rf_h
#define ON 0x00
#define OFF 0x20
#define BRIGHT 0x88
#define DIM 0x98
#include <stdlib.h>
#if defined(ARDUINO) && ARDUINO >= 100