public void pulse (final BA ba, final String EventName, final int msecHi, final int msecLow, final int Cycles) throws ConnectionLostException
{
if (EventName == null) throw new RuntimeException("EventName is Null");
Runnable r = new Runnable() {
@Override
public void run() {
Thread.currentThread().setPriority(6);
Integer count=Thread.activeCount();
Log.i("kolbe thread count ",count.toString());
try {
for(int x = 1; x <= Cycles; x++){
((DigitalOutput)getObject()).write(true);
android.os.SystemClock.sleep(msecHi);
((DigitalOutput)getObject()).write(false);
android.os.SystemClock.sleep(msecLow);
}
ba.raiseEventFromDifferentThread(getObject(), null, 0, EventName + "_done", true, new Object[] {true});
} catch (Exception e) {
ba.setLastException(e);
ba.raiseEventFromDifferentThread(getObject(), null, 0, EventName + "_done", true, new Object[] {false});
}
}
};
BA.submitRunnable(r, this, 0);
}