i2c-pwm-servo

bradzilla84/i2c-pwm-servo-16ch/i2c-pwm-servo

Set Servo PWM output
i2c-pwm-servo
@/i2c-pwm-servo
Set Servo PWM output
DEV@/i2c-servo-pwm-device
Pinnumber
Pin 1 to 16
PWMnumber
Freq 0 to 4096
UPDpulse
Triggers new write
i2c-pwm-servo
DEV
Pin
PWM
UPD
OK
OKpulse
Set
To use the node in your project you should have the bradzilla84/i2c-pwm-servo-16ch 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) {

    if (!isInputDirty<input_UPD>(ctx))
        return;
    
    auto pwm = getValue<input_DEV>(ctx);

    pwm->setPWM(getValue<input_Pin>(ctx), 0, getValue<input_PWM>(ctx));

    emitValue<output_OK>(ctx, 1);
}