0

BrightAuthor and HD810+Expander EM100 GPIO setting



Hi all, Does anyone know how to use BrightAuthor to set output on the GPIO of the expander EM100? I need to trigger or set GPIO on the expander to high whenever a video is played! There are 15 GPIO pins, but when I use BrightAuthor's command to set GPIO 10 or 12..on it showed me an error saying invalid GPIO number! I would highly appreciate it if anyone could help me answering this question. Thanks, Soulivanh

7 comments

  • 0
    Avatar
    RokuLyndon

    I posted in your other thread. THe gpio support in brightauthor is currently limited to onboard. You can use scripting for the expander. I posted a link to the thread, viewtopic.php?f=19&t=25245.

  • 0
    Avatar
    Sanothay


    Hi,
    Thanks for you support. I looked at the script samples you posted, but unfortunately there was no example about setting GPIO as outputs port.
    Could you please give me a few lines of example how to realize this:
    - video 1 plays, set GPIO expander pin 1 active.
    - video 1 plays, set GPIO expander pin 2 active...

    We actually need to set all GPIOs on the expander to be output ports.
    Thanks in advance,
    Soulivanh
  • 0
    Avatar
    RokuLyndon


    Are you using any gpios for inputs, on the unit/

    To set gpios for outputs, you would use the following, assuming your gpio control port object was called gpio:

    Gpio.Enableoutput(0)
    Gpio.Enableoutput(1)
    Gpio.Enableoutput(2)
    Gpio.Enableoutput(3)
    Gpio.Enableoutput(4)
    Gpio.Enableoutput(5)
    Gpio.Enableoutput(6)
    Gpio.Enableoutput(7)
    Gpio.Enableoutput(8)
    Gpio.Enableoutput(9)
    Gpio.Enableoutput(10)
    Gpio.Enableoutput(11)
    Gpio.Enableoutput(12)
    Gpio.Enableoutput(13)
    Gpio.Enableoutput(14)


    Then to turn on an output, you could use the following:

    gpio.SetWholeState(1)

    This turns oon gpio 1, and turns off all other gpio outputs. So, you only use setwholestate when you want only that one gpio to be on. or, you could use the following to set a specific on and off value.

    gpio.SetOutputState(1, true)           'turns on 1
    gpio.SetoutputState(0,false)        'turns off 0

  • 0
    Avatar
    Sanothay


    Hi Lyndon,
    Thanks again for your support. I was trying something very simple as below and BrightSign's Err LED was blinking. I guess this must have something to do with my custom script. Could you please help me to point out where the problem could be.
    Thanks, Soulivanh
    The script is below:

    print "BrightSign Button-LED Test Running"

    p = CreateObject("roMessagePort")

    Gpio = CreateObject("roControlPort", "Expander-GPIO")

    Gpio.SetPort(p)

    Gpio.Enableoutput(0)
    Gpio.Enableoutput(1)
    Gpio.Enableoutput(2)

    event_loop:

    gpio.SetWholeState(0)
    gpio.SetWholeState(1)
    gpio.SetWholeState(2)

    goto event_loop

  • 0
    Avatar
    Sanothay


    Hi Lyndon,
    One thing I've just discovered today is, when I connect the expander to BrightSign and then expander GPIO to the button board. I set the jumpers to outputs only but why the LED did not lid at all? none of them lid! Only the onboard GPIOs were lidding!
    Does this mean that the button board is broken or the expander or the cable that used to connect them is broken? Any suggestions please!
    Thanks again in advance,
    Soulivanh
  • 0
    Avatar
    RokuLyndon


    I'll check but I don't believe the gpio button board was made to interface with the expander. It's possible that it can be, but what cable did you use to connect them together?
  • 0
    Avatar
    Sanothay


    Hi,
    Thanks for a try. we built our own cable, we've got a hardware engineer here so he could make cables as requested. Anyway, the problem is now solved, I could connect them and make them talk to each other now. The problem before was wiring wrong number of GPIOs.
    Thanks,
    Soulivanh
Please sign in to leave a comment.