UltraViolet

PFx Brick scripted actions question

Recommended Posts

  As this topic relates to a project that will be on rails, I figured I would ask the question here.  I am attempting to script a seemingly basic function on the PFx Brick, but can't for the life of me understand why it doesn't work.  The scenario involves two LEDs - one is green and gets turned on immediately at power up (via a separate startup action), and the other is red.  The action I'm trying to script is when a remote control button (or joystick) is pressed and held, that action runs a script that turns off the green LED and turns on the red LED.  When the button is released, another script reverses the LEDs so green is again on and red is again off.

  The script code for when the button is pressed is as follows:

light 1 off

light 2 on

  The script code for when the button is released is as follows:

light 1 on

light 2 off

  The first line of each script file will work properly, so one light turns on and off as expected.  The second lines, however, never do anything, and the order of the two lines makes no difference.

  I noted in the documentation that in the case of "event" commands, multiple actions may be triggered, but each type of action can only be called once inside the statement.  While I'm not using "event" commands, is this still why multiple "light" commands get ignored?  This shouldn't be the case according to the limited script code examples I've seen.  I've also noted that the script files are only recognized as scripts by the PFx application if they have a ".txt" file extension, which is at odds with the documentation that says the extension should be ".pfx".

  If I have to make this work in a one line command, the only thing I can think of is to cheat with the RGB color LED command, as that would affect multiple output pins simultaneously.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.