0

Another HD2000 scsripting question



Can someone please tell me why this loops.....

i = CreateObject("roImagePlayer")
v = CreateObject("roVideoPlayer")
p= CreateObject("roMessagePort")
gpio= CreateObject("roGpioControlPort")
gpio.SetPort(p)

start:
i.DisplayFile("idle.jpg")
goto start


While this just leaves me with a blank screen at startup...?

i = CreateObject("roImagePlayer")
v = CreateObject("roVideoPlayer")
p= CreateObject("roMessagePort")
gpio= CreateObject("roGpioControlPort")
gpio.SetPort(p)

start:
i.DisplayFile("idle.jpg")
msg=wait(0,p)
if type(msg) = "roGPIOButton" then
if msg.GetInt() = 0 then
i.DisplayFile("idle2.jpg")
goto start


Thanks,
Chuck

2 comments

  • 0
    Avatar
    RokuLyndon


    your if statements are missing endifs.



    You have to use an endif if your statement is in block form.



    if a = 5 then print "5"



    can also be written:



    if a = 5 then

    print "5"

    endif



    You have two if statements but no endifs. You can rewrite it this way:



    if type(msg) = "roGPIOButton" then

      if msg.GetInt() = 0 then

        i.DisplayFile("idle2.jpg")

      endif

    endif



    I'm assuming the goto start isn't controlled by the if statements.





    or





    if type(msg) = "roGPIOButton" then

      if msg.GetInt() = 0 then i.DisplayFile("idle2.jpg")

    endif
  • 0
    Avatar
    Chuck Drew


    I see. This has been an attempt at trying to solve a GPIO timing issue by creating a autorun.bas by scratch. I replied to you this morning in another thread concerning a csv file and the problem of trying to turn off GPIO outputs at diffents times during a video playing. I hope that you can look at that today as I need a solution for a customer this week.



    Thanks for your help,

    Chuck
Please sign in to leave a comment.