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