Arduino Code, A duration can be specified, otherwise the wave continues until a call to noTone () .