====== Analog output and PWM ====== Select output initialization, value conversion, or PWM functions for the product's supported channels. ===== Analog Output ===== * [[:en-us_commands:reference:analogwriteinit|analogWriteInit()]] — Sets the resolution and prescaler of the output timer. * [[:en-us_commands:reference:analogwritefreq|analogWriteFreq()]] — Sets the PWM frequency of the specified output channel. * [[:en-us_commands:reference:analogwritemax|analogWriteMax()]] — Returns the maximum value available for the specified output channel. * [[:en-us_commands:reference:ianalogwriteinit|IanalogWriteInit()]] — Sets the maximum, minimum and mode of the MPAINO analog output. * [[:en-us_commands:reference:ianalogwrite|IanalogWrite()]] — Converts a user integer value to the analog output range and outputs it. * [[:en-us_commands:reference:ianalogwritef|IanalogWritef()]] — Converts a user floating-point value to the analog output range and outputs it. ===== 4~20mA Output ===== * [[:en-us_commands:reference:analogwrite2|analogWrite2()]] — Outputs a raw value for 4~20mA conversion on the specified channel. * [[:en-us_commands:reference:ianalogwrite2|IanalogWrite2()]] — Converts a user integer value to the 4~20mA output range. * [[:en-us_commands:reference:ianalogwrite2f|IanalogWrite2f()]] — Converts a user floating-point value to the 4~20mA output range. ===== PWM Output ===== * [[:en-us_commands:reference:pwm|PWM()]] — Outputs 8-bit or 16-bit PWM on the specified pin. * [[:en-us_commands:reference:fdpwm|FDPWM()]] — Outputs PWM at the specified frequency and duty cycle. * [[:en-us_commands:reference:pwmoff|PWMOFF()]] — Stops or re-enables PWM output on the specified pin. * [[:en-us_commands:reference:pwm_reset|PWM_RESET()]] — Resets all PWM states managed by the core. ===== Pulse Output ===== * [[:en-us_commands:reference:npwm_begin|NPWM_BEGIN()]] — Prepares pulse output with the specified frequency, duty cycle and pulse count. * [[:en-us_commands:reference:npwm|NPWM()]] — Outputs the prepared number of pulses. [[:en-us_commands:builtin|← Built-in function list]]