puls switching

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
Bob1208
Starting Member
Starting Member
Posts: 7
Joined: Wed Oct 31, 2012 9:51 pm

puls switching

Post by Bob1208 »

dear members,

i use now for 2 monhts domotiga whit succes.
i want to built an new fuction, i have an switch that can go on and off.
and i want if i press the on button its switch an variabele so i have 2 switches. exemple i press on var go's to 1 i press again on var go's to 2 and that repeats. same for the off button.
i have tried to write a script in an action but i constand get an "unexpected if". And i cant find anywere how to use this scripts. this is approximately what i have make.

If Var_schakelaar 1=1 then Var_schakelaar 1=2
if Var_schakelaar 1=2 then Var_schakelaar 1=1

Schakelaar 1 is a global variabele. can someone help me how i do this the best. i rather use value 2 and 3 from the switch is this also posible
sorry for my bad english i hope that u undestand.

regards Bob
Bob1208
Starting Member
Starting Member
Posts: 7
Joined: Wed Oct 31, 2012 9:51 pm

Re: puls switching

Post by Bob1208 »

Is there nobody who can help me? Are there some samples about the way to make some script. At the moment I dont untherstand the language. I have some programming experience whit robots. That language is 'Karel'.
I hope that some one can give me an example,or tell me what language this scripting is.

Regards Bob
User avatar
sj3fk3
Member
Member
Posts: 119
Joined: Mon Apr 23, 2012 8:33 am
Location: Abcoude

Re: puls switching

Post by sj3fk3 »

The if is a condition and the then is an action. Try splitting things up and you'll see it will work. There are some good examples here that you can use: http://www.domotiga.nl/projects/domotig ... ser_Manual and yes you could just use value 2 or 3 of that switch as long as nothing else is using it.
Kind Regards,
Greg.
Post Reply

Return to “DomotiGa Forum”