Jump to content
THIS IS THE TEST SITE OF EUROBRICKS! ×
THIS IS THE TEST SITE OF EUROBRICKS!

Recommended Posts

Posted

  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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...