I have made it this far but I can't get any gpio inputs to work. I have used this for the serial and it works fine. I no longer need the serial for a certain project i do need to use 3 gpio buttons to replace the "E" "S" "R" commands to use gpio 0 , 1 , 2. Can anyone help me with the syntax? Rokulyndon I can only imagine you surely have a solution as I have learned everything I know from you.
'****** CREATE MESSAGE PORTS 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 p = CreateObject("roMessagePort") tmr = CreateObject("roMessagePort") sp = CreateObject("roMessagePort") '****** CREATE GPIO 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 gpio = CreateObject("roGpioControlPort") gpio.SetPort(p) gpio.EnableInput(0) gpio.EnableInput(1) gpio.EnableInput(2) gpio.EnableInput(3) gpio.EnableInput(4) gpio.EnableInput(5) gpio.EnableOutput(6) gpio.EnableOutput(7) '****** CREATE TIMER 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 st = CreateObject("roSystemTime") Timer = CreateObject("roTimer") Timer.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,4800) serial.SetLineEventPort(p) '****** AVAILABLE AUDIO SETTINGS 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 ' ANALOG OUTPUT VALUES: ' 0 - Analog audio ' 1 - USB Audio ' 2 - SPDIF audio, stereo PCM ' 3 - SPDIF audio, raw AC3 ' 4 - Analog audio with SPDIF mirroring raw AC3 ' AUDIO MODE VALUES: ' 0 - AC3 Surround ' 1 - AC3 mixed down to stereo ' 2 - No audio ' (Options 0 & 1 only apply to video files, 2 applies to all audio sources) ' MAPPING VALUES: ' 0 - Stereo audio is mapped to HD810 analog output ' 1 - Stereo audio is mapped to Expander Audio 1 (left) if Expander is present ' 2 - Stereo audio is mapped to Expander Audio 2 (middle) if Expander is present ' 3 - Stereo audio is mapped to Expander Audio 3 (right) if Expander is present ' VOLUME SETTING RANGE: ' 0 = lowest to 100 full volume '****** VIDEO MPEG FILE SETTINGS 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 video = CreateObject("roVideoPlayer") video.SetPort(p) vm = CreateObject("roVideoMode") vm.SetMode ("1920x1080x29.97p") video.SetAudioOutput(3) video.SetAudioMode(0) video.MapDigitalOutput(0) video.SetVolume(100) '****** AUDIO MP3 FILE SETTINGS 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 audio = CreateObject("roAudioPlayer") audio.SetPort(p) audio.SetAudioOutput(0) audio.SetAudioMode(2) audio.MapStereoOutput(2) audio.SetVolume(100) '****** IMAGE SETTINGS 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 image = CreateObject("roImagePlayer") ok = image.SetDefaultMode(1) 'SET INITIAL IMAGE SCALING ok = image.DisplayFile("black.png") Print "System started." event_loop: msg = wait(0, p) if type(msg)="roStreamLineEvent" then buttonpress goto event_loop buttonpress: tm = msg If tm = "E" Then 'Start English ok = video.Stop() ok = image.StopDisplay() ok = audio.Stop() gpio.SetOutputState(6,1) 'English Feedback Light '*********** Put Video Filename in the quotes below 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 ok = video.PlayFile("RIVER_ENG.ts") '**************************************************************** If ok = 0 Then Print "Unable to read video file.": GoTo event_loop Print "Movie started from button panel." msg = wait(100, tmr) 'Delay in ms to sync MP3 file playback with video. ok = audio.PlayFile("ENG_AD.mp3") 'used as a place holder If ok = 0 Then Print "Unable to read audio description file." else Print "Audio Description audio started." endif timeout = st.GetLocalDateTime() Print timeout '*********** Put program length in seconds in the parenthesis below 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 timeout.AddSeconds(607) 'Number of seconds from start of movie until end '************************************************************************* Timer.SetDateTime(timeout) timer.Start() Print timeout GoTo clear_events EndIf If tm = "S" Then 'Start Spanish ok = video.Stop() ok = image.StopDisplay() ok = audio.Stop() gpio.SetOutputState(7,1) 'Spanish Feedback Light '*********** Put Video Filename in the quotes below 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 ok = video.PlayFile("RIVER_SPA.ts") '**************************************************************** If ok = 0 Then Print "Unable to read video file.": GoTo event_loop Print "Movie started from button panel." msg = wait(100, tmr) 'Delay in ms to sync MP3 file playback with video. ok = audio.PlayFile("SPA_AD.mp3") 'used as a placeholder If ok = 0 Then Print "Unable to read audio description file." else Print "Audio Description audio started." endif '*********** Put program length in seconds in the parenthesis below 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 timeout.AddSeconds(607) 'Number of seconds from start of movie until end '************************************************************************* Timer.SetDateTime(timeout) timer.Start() Print timeout GoTo clear_events GoTo clear_events EndIf GoTo event_loop clear_events: msg = wait(0, p) if type(msg) = "roTimerEvent" then Print "lights up." GoTo Clear_events EndIf if type(msg) = "roVideoEvent" then If msg.GetInt() = 8 Then Print "Movie has ended." Print "lights up." ok = image.DisplayFile("black.png") gpio.SetOutputState(6,0) 'turn off feedback english gpio.SetOutputState(7,0) 'turn off feedback spanish GoTo event_loop EndIf EndIf if type(msg)="roStreamLineEvent" then tm = msg If tm = "R" Then print "Stop button pushed." Print "lights up." ok = video.Stop() ok = image.StopDisplay() ok = audio.Stop() Timer.Stop() gpio.SetOutputState(6,0) 'turn off feedback english gpio.SetOutputState(7,0) 'turn off feedback spanish ok = image.DisplayFile("black.png") GoTo event_loop EndIf EndIf GoTo clear_events