analog-write-resolution

awgrover/analog-write-resolution/analog-write-resolution

Set the bit resolution of the PWM (analogWrite) for SAMD21 and SAMD51 boards. i.e. analogWriteResolution(). Usually 8..16 bits.
analog-write-resolution
@/analog-write-resolution
Set the bit resolution of the PWM (analogWrite) for SAMD21 and SAMD51 boards. i.e. analogWriteResolution(). Usually 8..16 bits.
BITSnumber
8,10,12,14,16 bits, depending on hardware
analog-write-resolution
BITS
READY
READYpulse
To signal that the change has been made. Error if board doesn't support analogWriteResolution()
To use the node in your project you should have the awgrover/analog-write-resolution 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 {
    //#include <Arduino.h>
    void evaluate(Context ctx) {
        Number bits = getValue<input_BITS>(ctx);
        #ifdef ARDUINO_ARCH_SAMD
        analogWriteResolution(bits);
        emitValue<output_READY>(ctx, true);
        #else
        raiseError<output_READY>(Context ctx)
        #endif
    }
}