Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Configures the output of the specified button, which can be either low (0) or high (1). If the button is not configured as an output, the resulting level is undefined. This method can also be used to configure LED output behavior onĀ BP200/B900 button boards.

boolean GetPinValue(in unsigned long Button)

Returns the output of the specified button.

void Close()

Shuts down the BSControlPortĀ instance, preventing it from further consuming resources. If this method is not called, garbage collection determines when the instance will be destroyed.

...

Code Block
languagejs
linenumberstrue
var bp900_gpio;
function myFunction()
{
    var bp900_setup = new BSControlPort("TouchBoard-0-LED-SETUP");
    bp900_setup.SetPinValue(0, 11)

    var bp900 = new BSControlPort("TouchBoard-0-LED");
    bp900.SetPinValue(0, 0x07fe)
    bp900.SetPinValue(1, 0x07fd)
    bp900.SetPinValue(2, 0x07fb)
    bp900.SetPinValue(3, 0x07f7)
    bp900.SetPinValue(4, 0x07ef)
    bp900.SetPinValue(5, 0x07df)
    bp900.SetPinValue(6, 0x07bf)
    bp900.SetPinValue(7, 0x077f)
    bp900.SetPinValue(8, 0x06ff)
    bp900.SetPinValue(9, 0x05ff)
    bp900.SetPinValue(10, 0x03ff)

    bp900_gpio = new BSControlPort("TouchBoard-0-GPIO");
    bp900_gpio.oncontroldown = function(e)
    {
        console.log('###### oncontroldown' + e.code);
    }
}

...


The following example displays events from a GPIO expander board. Note that using the equivalent roGpioControlPort object in BrightScript at the same time will result in unpredictable I/O behavior.

...