While each device is different, there are some keywords built into the Experimentor language to more naturally control output devices in your codes.

The following diagram details the language structure that you can use when setting a value on a device:

Setting device values EBNF diagram


Here are some examples of how this might work.

Example 1: Turning on a light

In this example we imagine a light on the main subject chamber controlled by an Arduino on pin 7.  First we define the device, then we create the device and define two variables: on and off.  Then we can use those variables to easily turn the light on and off.

So in the above example, the  deviceName  is mainChamberLight , and the newState is either the  on  variable or the  off  variable.

We could of course have simply done this to turn it on and off:

But the original syntax seems much friendlier to me.

Example 2: Controlling a food-hopper

In this example we have a food hoppe1r used to reward the animals that moves up and down.   This time it’s a Data Translation device controlling the food hopper, but we follow the same basic pattern.  Define the device, create the device, define some friendly variables, and then we can use the syntax defined in the diagram above to actually move the food hopper.