0

HD101 and EM100 GPIO's



I am trying to get the system to recongnize which control port has had an input trigger and would also like to activate outputs as well later. The script I am running is: gpioEx = CreateObject("roControlPort", "Expander-GPIO") gpioOnBoard = CreateObject("roControlPort", "Brightsign") p = createobject("roMessagePort") iplayer = CreateObject("roImagePlayer") vplayer = CreateObject("roVideoPlayer") vplayer.SetPort(p) gpioEx.SetPort(p) gpioOnBoard.SetPort(p) '****** CREATE SERIAL PORT 1 bbcodeparser bbcode.php bbcode.pl bbcode.txt bbparse.php engine existusers.txt extstusers.parsed1.txt extstusers.parsed2.txt extstusers.parsed.txt htmlentdec.php logs nbbc_files phpbb2zendesk.log phpbb3-to-zd.log phpbb3-to-zdnew.log phpbb3-to-zd.sh phpbb3-to-zd-undo.sh phpbb_db phpbbdb3 phpbbusers.xls postids.tmp post_results.xml posts.xml SBBCodeParser.php stdout studioloft_phpbb.sql styles test2 test4 tests testtext.txt test.txt txt2html_func.php txt2html.php txthtmlencode.php users.json users.json.txt users_tmp.json users_tmp_nc.json zddelete zdget zdpost serial = CreateObject("roSerialPort",0,115200) serial.SetLineEventPort(p) serial.SetEOL(chr(10)) REM Constants / Settings / Variables iplayer.PreloadFile("black.bmp") print "system started" gpioEx.EnableInput(0) gpioEx.EnableInput(1) gpioOnBoard.EnableInput(0) gpioOnBoard.EnableInput(1) REM Video Database DIM vlist[12] vlist[0]="TRADE SCENE.mpeg" vlist[1]="FOUS-TV-171 Fort Union Trading Post_transport.ts" vlist[2]="GUN EVOLUTION.Copy_NEW.mpeg" vlist[3]="FORT MUSIC.mpeg" Start: iplayer.DisplayPreload() loop: msg = wait(0,p) if type(msg) = "roControlDown" then button_pressed = msg.GetInt() if button_pressed = 0 then vplayer.PlayFile(vlist[button_pressed]) elseif button_pressed = 1 then vplayer.PlayFile(vlist[button_pressed]) elseif button_pressed = 2 then vplayer.PlayFile(vlist[button_pressed]) elseif button_pressed = 3 then vplayer.PlayFile(vlist[button_pressed]) endif else if type(msg) = "roVideoEvent" then if msg.GetInt() = 8 goto start endif goto loop The movies play fine with the exception that they are only being triggered by the OnBoard GPIO's and not from the expander. Even though I have not set inputs 2,3 on the HD1010 they still trigger the video's. Must be a default setting with the system if not labled in script. What I would like to achieve is that I can trigger from either device but set outputs high on both devices as well. I have tried modifiying to find out where the trigger came from but had no luck. Code would compile and load but not work. Any help or suggestions would be appreciated. Thanks Will

5 comments

  • 0
    Avatar
    RokuLyndon


    This sounds like a wiring or unit problem. If you've manually only set gpios 0 and 1, then those are the only inputs that should work. You shouldn't get 2 and 3 also. SO, either things aren't wired properly, there's some kind of short, or cable problem, or there's a problem with the port on the unit.

    Also, if you turn on internal 0 and 1, and external 0 and 1, there's no way to tell the difference. Both will be seen as 0 and 1. What you could do is use the old controlport object for the internal gpio.

    gpioOn = createobject("roGpioControlPort")

    THen, listen for events of type "roGpioButton". Those would only come from the old object. Then you know it's only the onboard gpio events.
  • 0
    Avatar
    Lovell, Willard


    I was trying this all with your sample block that you listed.  I thought though we could not use the old object strings with the new firmware
  • 0
    Avatar
    RokuLyndon


    No, that's not the case. You can use the old controlport object.
  • 0
    Avatar
    Lovell, Willard


    Lyndon

    When using the expander GPIO's, do you need to use two usb ports if you are using the "B" style for audio signal from the Main unit?
    I was reading the hardware guide and notice that it stated that the "B" was upstream and the other two "A" style were highspeed downstream.
    Can you clarify for me.

    Thanks and have a great day

    Will
  • 0
    Avatar
    RokuLyndon


    You don't have to use the USB ports on the expander. IF you're using onboard USB for audio, it's unrelated to the expander USB.
Please sign in to leave a comment.