View previous topic :: View next topic |
Author |
Message |
flashcode
Joined: 11 Oct 2009 Posts: 7
|
Posted: Tue Jan 14, 2014 9:35 pm Post subject: Macro repeating a key code every few seconds |
|
|
Does anyone know if it is possible to create a macro that will repeat a key code every few seconds for a certain number of minutes when a specific key is pressed once? |
|
Back to top |
|
|
pH7_jp1
Joined: 14 Sep 2003 Posts: 480 Location: Sterling Heights, MI |
Posted: Thu Jan 16, 2014 9:49 am Post subject: |
|
|
Yes.
Create a single macro that contains only the one key press, plus a pause of the appropriate length of time (between each press).
Create a second macro that has several invocations of the first macro (say for instance 10).
Create a third macro that invokes the second macro an appropriate number of times (for example, 5 times to repeat the original command 50 times). |
|
Back to top |
|
|
vickyg2003 Site Admin
Joined: 20 Mar 2004 Posts: 7073 Location: Florida |
Posted: Thu Jan 16, 2014 1:21 pm Post subject: Re: Macro repeating a key code every few seconds |
|
|
flashcode wrote: | Does anyone know if it is possible to create a macro that will repeat a key code every few seconds for a certain number of minutes when a specific key is pressed once? |
Ewww, you want a code to repeat for minutes. That would never work at my house, no one would ever keep a remote pointed at the device for even 1 minute, let alone several.
What are you trying to accomplish with this macro? _________________ Remember to provide feedback to let us know how the problem was solved and share your upgrades.
Tip: When creating an upgrade, always include ALL functions from the oem remote, even if you never plan on assigning them to a button. Complete function lists makes an upgrade more helpful to others.
|
|
Back to top |
|
|
flashcode
Joined: 11 Oct 2009 Posts: 7
|
Posted: Thu Jan 16, 2014 1:57 pm Post subject: |
|
|
Hi guys! Thks for the answers.
pH7_jp1, I'll look into your suggestion, although I still don't know how to create delays between key presses and repetitions.
vickyg2003, I need a message on the screen called every few seconds. That's why. |
|
Back to top |
|
|
vickyg2003 Site Admin
Joined: 20 Mar 2004 Posts: 7073 Location: Florida |
Posted: Thu Jan 16, 2014 2:19 pm Post subject: |
|
|
Maybe you should look into a recursive solution.
I use recursion on the long side of a key press, keep circling until I release the key. But I bet you could use recursion to keep on circling until you press and hold the key again. I haven't tried it in that manner but I think it would work on the extenders I wrote. Other extender writers might not have the same feature set. |
|
Back to top |
|
|
mdavej Expert
Joined: 08 Oct 2003 Posts: 4500
|
Posted: Thu Jan 16, 2014 2:27 pm Post subject: |
|
|
Realize you'll need an extender for all of the suggested solutions so far. If you aren't running an extender, that may be why you can't see how to do it.
The problem I see is that these would probably tie up the remote while the macro loop is running. I do like the recursion idea though. Very elegant. |
|
Back to top |
|
|
flashcode
Joined: 11 Oct 2009 Posts: 7
|
Posted: Thu Jan 16, 2014 9:22 pm Post subject: |
|
|
vickyg2003, it would be a clean solution if I could press a key once to start the process and press it again to stop it (unless I could find a solution to use any key to reset the process). That way I would free up the remote for other functions as it would be busy while the macro loop is running, as mdavej pointed out.
Recursion and extender are the subjects I'll need to look deeper into.
Thanks, guys! |
|
Back to top |
|
|
vickyg2003 Site Admin
Joined: 20 Mar 2004 Posts: 7073 Location: Florida |
Posted: Fri Jan 17, 2014 7:08 am Post subject: |
|
|
flashcode wrote: | That way I would free up the remote for other functions as it would be busy while the macro loop is running |
No, there is only one loop, even in an extender. Its single minded. The remote will need to continue to be pointed at the unit and can't be used for anything else until it is released or the batteries die.
If this will work at all, depends on how LKP was implemented on the remote that you have. _________________ Remember to provide feedback to let us know how the problem was solved and share your upgrades.
Tip: When creating an upgrade, always include ALL functions from the oem remote, even if you never plan on assigning them to a button. Complete function lists makes an upgrade more helpful to others.
|
|
Back to top |
|
|
flashcode
Joined: 11 Oct 2009 Posts: 7
|
Posted: Sat Jan 18, 2014 2:28 pm Post subject: |
|
|
Thanks, vickyg2003. I'll try an extender.
pH7_jp1, I tried your solution using several macros but it seems like you can't invoke a macro using another macro. I can only call a macro using a key. And a macro can only hold 15 commands with a delay of 0.4s each - not enough. Thanks for the idea, anyway. |
|
Back to top |
|
|
flashcode
Joined: 11 Oct 2009 Posts: 7
|
Posted: Mon Jan 20, 2014 10:00 pm Post subject: |
|
|
Hi, guys!
After several tries, I got it working. I used an extender and, after checking on macros from other posts, I discovered how to use Pause and delays. The final work is bellow; a command M3 is sent to the equipment every 10 seconds for 60 minutes.
Especial Protocol:
SAT - Phantom1 - Pause [TV:1104] - $18 (delay = 1,5s)
Macros:
Play - 6x Phantom3 - Repeat 6x = 360s = 60min
Phantom3 - 10x Phantom2 - Repeat 10x = 600s = 10min
Phantom2 - 6x (M3;Phantom1) - Repeat 6x (M3 + delay) = 60s = 1min
Still, there are two questions I could not answer:
- Is there a way to press a key and break a macro execution?
- Although there is only a burst of IR every 10 seconds, in between bursts there are 16 blinks on the LED - this causes the battery to get drained much faster. Is there a way to get the LED only blink when the IR is activated, the way macros with unassigned keys work when not using an extender?
Thank you, all! |
|
Back to top |
|
|
|