init-pwm

hussainfawzi/fast-pwm/init-pwm

No description
init-pwm
@/init-pwm
INITpulse
Feed a pusle along with required frequency and duty cycle.
init-pwm
DONE
INIT
DONEpulse
Spits a pulse when done
To use the node in your project you should have the hussainfawzi/fast-pwm 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

#pragma XOD require "https://github.com/terryjmyers/PWM"

{{#global}}
#include <PWM.h>
{{/global}}

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
     if (!isInputDirty<input_INIT>(ctx))
        return;
    InitTimersSafe();
    emitValue<output_DONE>(ctx, 1);
};