I find it works best if I treat the device like a particularly stupid knight recruit. Give it very specific instructions, one step at a time, and do not be surprised when it does precisely what you tell it to rather than what any sensible person would understand that you wanted it to do.