Code: Select all
Command unknown: 1=11 and 1=3
Moderators: grovkillen, Stuntteam, TD-er
Code: Select all
Command unknown: 1=11 and 1=3
Code: Select all
on Switch#State do
if %eventvalue1%=1
let,1,[int#1]+1 // Count pulses
timerset,1,1 // Set timer to clear the counter
else
if %eventvalue1%=11 and [int#1]=3
// Accept the code
let,1,0 // Clear counter
GPIO,12,0
endif
endif
endon
on rules#timer=1 do
let,1,0 // Clear counter
endon
Code: Select all
on Switch#State do
if %eventvalue1%=1
let,1,[int#1]+1 // Count pulses
timerset,1,1 // Set timer1 to clear the counter
else
if %eventvalue1%=11
let,2,[int#2]+1 //Count long press
timerset,1,1
else
if [int#2]=2 and [int#1]=5 //2 long and 3 short
// Accept the code
let,1,0 // Clear counter 1
let,2,0 // Clear counter 2
GPIO,12,0
timerset,2,5 //Set timer 2 to turn off led
endif
endif
endif
endon
on rules#timer=1 do
let,1,0 // Clear counter 1
let,2,0 //Clear counter 2
endon
on rules#timer=2 do
GPIO,12,1
endon
Code: Select all
on Switch#State do
if %eventvalue1%=1
let,1,[int#1]+1 // Count pulses
timerset,1,3 // Set timer to clear the counter
elseif %eventvalue1%=11
let,2,[int#2]+1 //sum long press
timerset,1,3
else
if [int#2]=1 and [int#1]=2 //1 long and 1 short
// Accept the code
let,1,0 // Clear counter
let,2,0 // Clear counter
GPIO,12,0
timerset,2,5
endif
endif
endon
on rules#timer=1 do
let,1,0 // Clear counter
let,2,0
endon
on rules#timer=2 do
GPIO,12,1
endon
Users browsing this forum: No registered users and 17 guests