mirror of
https://github.com/pyrou/X10RF-Arduino.git
synced 2026-09-22 18:42:23 +00:00
add BRIGHT/DIM commands support
This commit is contained in:
1 parent
fd9d988bc6
commit
7b272c80ed
3 files changed
+19
-2
No files matched your search
@@ -16,3 +16,12 @@ RFXmeter KEYWORD2
|
|||||||
RFXsensor KEYWORD2
|
RFXsensor KEYWORD2
|
||||||
x10Switch KEYWORD2
|
x10Switch KEYWORD2
|
||||||
x10Security KEYWORD2
|
x10Security KEYWORD2
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Constants (LITERAL1)
|
||||||
|
#######################################
|
||||||
|
|
||||||
|
ON LITERAL1
|
||||||
|
OFF LITERAL1
|
||||||
|
BRIGHT LITERAL1
|
||||||
|
DIM LITERAL1
|
||||||
@@ -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
|
x10buff[0] = x10buff[0] << 4; // House code goes into the upper nibble
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case 0: x10buff[2] = (x10buff[2] | 0x20); break;
|
case ON:
|
||||||
case 1: x10buff[2] = (x10buff[2] & 0x20); break;
|
case OFF:
|
||||||
|
case BRIGHT:
|
||||||
|
case DIM:
|
||||||
|
x10buff[2] = command; break;
|
||||||
}
|
}
|
||||||
// Set unit number
|
// Set unit number
|
||||||
unit_code = unit_code - 1;
|
unit_code = unit_code - 1;
|
||||||
|
|||||||
@@ -15,6 +15,11 @@ Tested on a TI Stellarpad (LM4F120H5QR) and Energia 0101E0010. This should also
|
|||||||
#ifndef x10rf_h
|
#ifndef x10rf_h
|
||||||
#define x10rf_h
|
#define x10rf_h
|
||||||
|
|
||||||
|
#define ON 0x00
|
||||||
|
#define OFF 0x20
|
||||||
|
#define BRIGHT 0x88
|
||||||
|
#define DIM 0x98
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if defined(ARDUINO) && ARDUINO >= 100
|
#if defined(ARDUINO) && ARDUINO >= 100
|
||||||
|
|||||||
Reference in new issue
Block a user