Repeating commands like Girder does?

Interested in integrating USB-UIRT support into an application? Look here!

Moderator: jrhees

Repeating commands like Girder does?

Postby roschler » Sat Nov 19, 2005 2:26 pm

In Girder, when you open the USB-UIRT plugin dialog box by clicking the on "Settings" button from the "Plugins" tab, you see a field titled "Repeat". I assume this means how many times the IR command is sent to the USB UIRT, correct?

If this is true, how do I emulate the same behavior from my application? Which of the following approaches will repeat the command 4 times like Girder does?:

1) Making 4 separate transmit commands to the USB UIRT DLL. If this is the correct approach, should I add a "sleep" command before each repetitive call and if so, how many milliseconds?

2) Concatenate the IR codes string in the field labeled "Code 1". If this is the correct approach, then how do I do the concatenation? For example, if the IR code string is "R00008080", would I send the USB UIRT:

- "R00008080R00008080R00008080R00008080"

or

- "R00008080000080800000808000008080", only using the "R" prefix the first time and repeating only the numeric digits after that?

3) Another approach?

I ask this because I have noticed that for one particular command, Girder always gets the device to respond to the command, but when I send it from my app I sometimes have to repeat the command once or twice to get the device to respond (depending on the device's orientation to the USB UIRT).

If you have any additional timing tips on sending the command using repeats I'd appreciate it. My secondary worry is that if I do it wrong, I'll end up having the device interpret the repeated command as multiple commands instead of as a single command repeated multiple times. Since the command is a "toggle" command, if the device interprets the repeated commands as two separate commands instead of just one, they will "cancel out" and the device will do nothing. Note, when Girder sends the command with the Repeat field set to 4, the device successfully interprets it as a single command and quite reliably.

The device in this case is a Robopet.

Thanks.
Robert
RobotsRule Discussion Forum
http://www.robotsrule.com/phpBB2/
roschler
 
Posts: 21
Joined: Fri Nov 19, 2004 1:18 am

Postby jrhees » Mon Nov 21, 2005 4:47 pm

You're thinking too hard! :)

Just adjust the 'repeatCount' parameter in the TransmitIR() call.

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 20 guests

cron