Micro-manager and arduino-switch help

I am trying to understand how to use Arduino-switch in micro-manager from a beanshell script. The micro-manager website documents well the arduino firmware, but I cannot locate the documentation to use the device from a beanshell script. Is this described somewhere?

The specific application is simple: I’d like to trigger pin 8 at X ms intervals for a total of N triggers. From the firmware description it seems that one should be able to specify X and N. However, in the Device Property Browser I don’t see the appropriate properties to set. Perhaps it has to do with the “Sequence” property but I can’t find documentation for how to use this property.

mmc.setProperty(“Arduino-Switch”, “State”, “1”); // trigger pacemaker TTL with “1” = pin 8
mmc.setProperty(“Arduino-Switch”, “SetPattern”, “1”); // pattern has 1 element
mmc.setProperty(“Arduino-Switch”, “Nr. Patterns Used”, “1”); // one pattern used
// ? how to specify the delay of X ms between triggers?
// ? how to specify the total number of N events?
mmc.setProperty(“Arduino-Switch”, “TriggerMode”, “Start”);

mmc.setProperty(“Arduino-Switch”, “TriggerMode”, “Stop”);

Many thanks and sorry if this question is answered in existing documentation.

What is the value of X? The Arduino firmware does not have facilities for self-timed outputs. The “TriggerMode” you are using is for the Arduino to “follow” triggers provided to its input (usually coming from the camera to indicate that the camera is exposing. If you want it to turn on and off with specific timings, you could write all of that out in a Beanshell script, but timing will not be very precise (as it is subject to all the uncertainty of timing caused by the complex underlying computer operating system).

You are probably be better of writing a simple firmware for the Arduino that does exactly what you want. You could have the trigger started by an input that goes high that you set high using a second Arduino that runs the MM code so that you can start it from MM.