Figuring out how to make a buzzer node


i wanted to make a buzzer node in xod but i cant figure out how to do so, because it needs to have different pitches, any ideas?


Have you tried using a pwm node?



You can try to make a simple C++ wrapper node around Arduino’s tone and noTone. Something like:

// ... not checked draft ...

void evaluate(Context ctx) {
    auto port = getValue<input_PORT>(ctx);
    auto freq = getValue<input_FREQ>(ctx);
    auto enable = getValue<input_EN>(ctx);
    if (enable) {
        pinMode(port, OUTPUT);
        tone(port, freq);
    } else {