Hey,
I have a kind of slot-machine (Html, JS, CSS). I use a GPIO trigger to start the game. A button is pressed and my brightscript tells the slot-machine that the game is being played.
Now I would like to implement an additional output. As soon as a win is achieved, GPIO port 1 should be activated. I use this Brightsign script for this:
sub Init()
port = CreateObject(“roMessagePort”)
m.html = CreateObject(“roHtmlWidget”, port)
m.html.SetUrl(“file:///sd:/index.html”)
m.html.Show()
controlPort = CreateObject(“BSControlPort”, 1)
pluginPort = CreateObject(“roMessagePort”)
plugin = CreateObject(“roSGNode”, “BrightScriptComponent”)
plugin.SetPort(pluginPort)
while true
msg = wait(0, port, pluginPort)
if type(msg) = “roSGNodeEvent” then
handleMessage(msg, controlPort)
end if
end while
end sub
sub handleMessage(msg as Object, controlPort as Object)
if msg.getField() = “spinTrigger” then
if msg.getData() = “activateGPIO” then
controlPort.SetState(true)
sleep(500)
controlPort.SetState(false)
end if
end if
end sub
However, when I add this script to Brightauthor 5.0 under Autorun, the Brightsign no longer starts.
I am also wondering whether I still need an event handler for my interactive presentation. However, it is not clear to me how to use this if GPIO port 1 is automatically grayed out as soon as I define GPIO port 1 as the output in the settings.
Does anyone have a solution here?