View previous topic :: View next topic |
Author |
Message |
Barf Expert
Joined: 24 Oct 2008 Posts: 1416 Location: Munich, Germany |
Posted: Tue Feb 23, 2016 11:14 am Post subject: "Toggles" with more than two values? |
|
|
Has anyone seen or heard about protocols using "toggles" with more than two values? |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21248 Location: Chicago, IL |
Posted: Tue Feb 23, 2016 11:53 am Post subject: |
|
|
What do you mean by a toggle? Do you mean a bit in a signal (which obviously can only be 0 and 1) or do you mean a toggle button (like POWER)? If it's the latter, an INPUT button has more than one value. Or do you mean you have a signal where there are 2 or more bits that increment with each button press? _________________ Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help! |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1416 Location: Munich, Germany |
Posted: Tue Feb 23, 2016 12:01 pm Post subject: |
|
|
The last one. By definition a toggle takes two values, therefore I wrote "toggle".
IRP e.g. <...>(... T:2 ,T=(T+1)%4)[T@:0..3=0] |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21248 Location: Chicago, IL |
Posted: Tue Feb 23, 2016 12:03 pm Post subject: |
|
|
Yeah, I don't think I've heard of one of those before, but I take it that you just found one? _________________ Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help! |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1416 Location: Munich, Germany |
Posted: Tue Feb 23, 2016 12:12 pm Post subject: |
|
|
No, for this ticket I am considering if it is safe to assume that there can only be two. It would simplify implementation quite a bit. |
|
Back to top |
|
|
3FG Expert
Joined: 19 May 2009 Posts: 3368
|
Posted: Tue Feb 23, 2016 5:31 pm Post subject: |
|
|
Not at all sure I understand the question, but consider OrtekMCE: Code: |
{38.6k,480}<1,-1|-1,1>([P=0][P=1][P=2],4,-1,D:5,P:2,F:6,C:4,-48m)+{C=3+#D+#P+#F} |
|
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1416 Location: Munich, Germany |
Posted: Wed Feb 24, 2016 3:23 am Post subject: |
|
|
No, you misunderstood. In OrtecMCE, P changes between intro, repeat, and ending, not between invocations. A toggle, or "toggle", maintains its value between invocations, "persistance", in my extension of the IRP-notation indicated by a trailing @. Thanx anyhow! |
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4524 Location: Cambridge, UK |
Posted: Wed Feb 24, 2016 8:33 am Post subject: |
|
|
Barf wrote: | No, for this ticket I am considering if it is safe to assume that there can only be two. It would simplify implementation quite a bit. |
I can't point you to a protocol that uses more than one bit, but the MAXQ protocol structure certainly has explicit provision for this possibility. Two or more consecutive bits can be specified, with those bits being modified on successive keypresses in one of three ways: (a) all selected bits toggled (inverted), (b) those bits being replaced by an integer value that is incremented on successive keypresses, or (c) those bits being replaced by an integer value that is decremented on successive keypresses.
As far as I am aware, the protocol engine for other processors also includes an n-bit counter, where n>1, that is incremented on successive keypresses, which may be used to cause the same behaviour as this for the MAXQ processors. _________________ Graham |
|
Back to top |
|
|
The Robman Site Owner
Joined: 01 Aug 2003 Posts: 21248 Location: Chicago, IL |
Posted: Wed Feb 24, 2016 5:40 pm Post subject: |
|
|
I don't think he's asking whether we could program it into an executor, where obviously we could, I think he's asking if anyone has seen an actual IR signal which has a toggle that is greater than 1 bit. (Of course, purely from an English language point of view, I would challenge that such a field should be called a "toggle"). _________________ Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help! |
|
Back to top |
|
|
mathdon Expert
Joined: 22 Jul 2008 Posts: 4524 Location: Cambridge, UK |
Posted: Wed Feb 24, 2016 6:44 pm Post subject: |
|
|
The Robman wrote: | I don't think he's asking whether we could program it into an executor |
And that isn't what I was answering, either. The point about MAXQ protocols is that there is an explicit provision for such "multi-bit toggles" without any need for program code. It is part of the data structure that precedes any actual code. The implication, to me at any rate, is that UEI envisages a need for this facility.
Edit: I have done some checking and found several examples that use this facility. Here is the IRP from PID 004A as one example:
{33.5k,479}<1,-17|1,-11>(T=T+1,(~T:-2,A:3:2,X:6,1,^136m)+).
Others are PIDs 002C, 00D1, 00E5 and 00F4. _________________ Graham |
|
Back to top |
|
|
Barf Expert
Joined: 24 Oct 2008 Posts: 1416 Location: Munich, Germany |
Posted: Thu Feb 25, 2016 3:29 pm Post subject: |
|
|
Thanx for the answers, in particular -- of course -- to Graham for the definitive answer.
In case it interests someone: It turned out that it was not that hard to implement the general case. |
|
Back to top |
|
|
|