The ping method is blocking. Consider using the ping_timer method instead. However note that ping_timer uses Timer2 which is also used by Tone. There's really no win here... either the blocking behavior here could conflict with another Firmata feature or by using timers certain PWM-based features cannot be used. There has to be a trade-off.