tone

vasily/tone/tone

Needed for continuous buzzing
tone
@/tone
Needed for continuous buzzing
PORTport
Set port with connected buzzer
FREQnumber
Set buzz frequency
UPDpulse
Run buzz with FREQ frequency on PORT
tone
PORT
FREQ
UPD
To use the node in your project you should have the vasily/tone library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    //auto inValue = getValue<input_IN>(ctx);
    //emitValue<output_OUT>(ctx, inValue);
    if (!isInputDirty<input_UPD>(ctx))
        return;
    auto port = getValue<input_PORT>(ctx);
    auto freq = getValue<input_FREQ>(ctx);
    //pinMode(port, OUTPUT);
    tone(port, freq);
}