mbot-buzzer-tone

hio/mbot-gus/mbot-buzzer-tone

No description
mbot-buzzer-tone
@/mbot-buzzer-tone
DEV@/mbot-buzzer-device
FREQnumber
DURnumber
NOpulse
UPDpulse
mbot-buzzer-tone
DEV
FREQ
DUR
NO
UPD
Done
Donepulse
To use the node in your project you should have the hio/mbot-gus 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

node {
    void evaluate(Context ctx) {
        // The node responds only if there is an input pulse
        if (!isInputDirty<input_UPD>(ctx))
           return;
        

        auto buzzer = getValue<input_DEV>(ctx);
        auto freq = getValue<input_FREQ>(ctx);
        auto dur = getValue<input_DUR>(ctx);

        buzzer-> tone(freq,dur);

        emitValue<output_Done>(ctx, 1);
   }
}