Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Skin commands to control USB relay

  1. #1
    Variable Bitrate
    Join Date
    Mar 2007
    Location
    Nashua, NH
    Posts
    243

    Skin commands to control USB relay

    I am using RR from 01-01-10 and am trying to figure out how to control a USB relay when I select HD Radio and when the audio source changes to something other than HDRadio. The relay board will control the power antenna. I want it to extend only when HD Radio is selected.

    I have looked for a skin how-to and can't find it. I have done a number of searches in these forums and found nothing applilcable.

    Can someone give me some insight on how to execute an external command to control the relay?

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    Do you have an external board or anything like that to control the relay ? how do you have the relay hooked up ?

    At the least you're going to need the SerialSwitch plugin with the relay hooked up to the serial port (output pin) -- probably using a transistor+resistor at the least.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  3. #3
    Variable Bitrate
    Join Date
    Mar 2007
    Location
    Nashua, NH
    Posts
    243
    It is a board that has a USB interface that appears to the computer as a serial port. I already wrote a small util to open the serial port and turn the realy on or off. I just want to know how to call the program I wrote when I select HD Radio and then again when the audio source changes.

  4. #4
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    You already did the hardest part.. you just need to use the RUNQ command to execute your application when going in/out of the screen.. simplest way is to edit the .skin files:

    in menu.skin -- change "RADIO" for "RUNQ;c:\myapp\antennaup.exe||RADIO"
    in radio_player.skin -- change "EXIT" for "EXIT||RUNQ;c:\myapp\antennadown.exe"

    Alternatively, you can put the antenna down command on the buttons for the audio/video in menu.skin so that it only lowers the antenna when you switch the source of audio.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  5. #5
    Variable Bitrate
    Join Date
    Mar 2007
    Location
    Nashua, NH
    Posts
    243
    Great...that's what I needed!! Thanks!

  6. #6
    Variable Bitrate
    Join Date
    Mar 2007
    Location
    Nashua, NH
    Posts
    243
    Hmmm...one more problem. When I go to radio (antenna goes up...yea!), back to main menu, then go to video (antenna goes down), when I stop the video it automatically goes back to radio, but the antenna up command is not executed again.

    Any thoughts?

  7. #7
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    yes, that's a typical thing using the resume feature.

    Try adding the following to your exectbl.ini (replace with your command):

    "ONSCREENCHANGE","RUNQ;c:\myapp\antennaup.exe" ,fm

    be sure to remove the "antennaup" command from the RADIO button (as it should no longer be needed). You may want to put a check on your app so it doesn't try to raise the antenna when it's already "up".
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  8. #8
    Variable Bitrate
    Join Date
    Mar 2007
    Location
    Nashua, NH
    Posts
    243
    Quote Originally Posted by guino View Post
    yes, that's a typical thing using the resume feature.

    Try adding the following to your exectbl.ini (replace with your command):

    "ONSCREENCHANGE","RUNQ;c:\myapp\antennaup.exe" ,fm

    be sure to remove the "antennaup" command from the RADIO button (as it should no longer be needed). You may want to put a check on your app so it doesn't try to raise the antenna when it's already "up".
    Is there a place to find a reference for these commands? The above command works great for putting the antenna back up when resuming the radio. But when the system comes out of standby and the radio was the last source (so it continues as the computer wakes up), the antenna doesn't go up.

    I am guessing there's an ONRESUME command. Any chance of that? Would the text be the same? i.e.:

    "ONRESUME","RUNQ;c:\myapp\antennaup.exe",fm

    Thanks for the help Guino!!

  9. #9
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    you can try exactly what you posted:

    "ONRESUME","RUNQ;c:\myapp\antennaup.exe",fm

    in any case, the events "ONxxxxx" are listed on exectbl.ini and everything else is described in Skin commands.txt (Docs folder).
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  10. #10
    MySQL Error
    Auto Apps:loading...

    Join Date
    Oct 2004
    Posts
    5,259
    but that would put the antenna up, even if radio not the ACTIVESOURCE

    i think a BYVAR;ACTIVESOURCEID

    is your key
    -Thanks
    Mitch
    www.rush2112.net

    "Did you test it in carwings??"

    Sun, Come shine my way
    May healing waters bury all my pain
    Wind, Carry me home
    The fabric of reality is tearing apart
    The piece of me that died
    Will return To live again

Page 1 of 2 12 LastLast

Similar Threads

  1. Digital FX 2.0 Transparent Released
    By JohnWPB in forum RR Skins No Longer Supported
    Replies: 3759
    Last Post: 03-07-2008, 01:23 PM
  2. The WinXPe Colab Installation instructions
    By darkslyde in forum WinNT Based
    Replies: 1
    Last Post: 02-17-2008, 06:59 PM
  3. USB Controlled Relay Board or general output
    By 2k1Toaster in forum Hardware Development
    Replies: 68
    Last Post: 05-29-2007, 12:40 PM
  4. TO ALL SKINNERS (read this)
    By jeep642 in forum Road Runner
    Replies: 1
    Last Post: 05-01-2007, 12:23 PM
  5. USB Sound Card with ASIO driver and volume control
    By tbdombrosky in forum General Hardware Discussion
    Replies: 0
    Last Post: 02-04-2003, 12:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •