MiceOnABeam Product Documentation

Modified: 4/26/2013 3:30 PM
Recently changed articles You can subscribe to this wiki article using an RSS feed reader.

Tutorial - Step 9

Previous 1 2 3 4 5 6 7 8 9 10 11 12 13 14  Next

 


 

  • The next step is to provide Entry Code for the Off state, so that whenever the state is entered, this code will be executed in order to change the light to it's off color. Right-click on the state Off and select Edit Properties

 

  • The Properties Editor for the state is then opened. Right-click within the Entry Action and select the LSL Action SetColor from the Insert Action...Looks... menu.

  • The LSL Action Configuration Wizard then opens up. Right-click on the field to select the color and choose Grey. Click on the OK button to save.

 

  • The LSL Action is then saved in the Entry Code. When the LSL is generated for the script, the LSL Action here will be automatically converted to the right LSL function call to change the color to grey.
  • Click the OK button on the Properties Editor when done.

 

  • Whenever we enter the On state, we need to start a two-second timer in order to cycle through the three colors of the light. Similarly when turning the light off, we need to stop the timer as we leave the On state.
  • As before, but this time for the On state, right-click on the state and select Edit Properties.
  • Right-click in the Entry Action field and select the LSL Action StartTimer from the Insert Action...Control... menu.

 

  • The LSL Action Configuration Wizard will be opened. Enter Timeout for the value and then click the OK button. Note how we're referencing the state variable we defined earlier.

 

  • Now right-click in the Exit Action field and select the LSL Action StopTimer from the Insert Action...Control... menu. This LSL Action has no configurable parameters so the action directive is immediately added to the code.

  • Click the OK button on the Properties Editor when done.

  • At this point our script model should look like the above. 

Previous 1 2 3 4 5 6 7 8 9 10 11 12 13 14  Next

Tags:
Home: MiceOnABeam Product Documentation Copyright © 2010-2018 MiceOnABeam Software