en-us_commands:reference:ianalogwrite2
This is an old revision of the document!
Table of Contents
IanalogWrite2()
IanalogWrite2() converts a user integer value to the 4~20mA output range.
void IanalogWrite2(uint8_t ch, int32_t min, int32_t max, int32_t value)
Commands
| Command | Arguments | Return Value | Operation |
|---|---|---|---|
IanalogWrite2(ch, min, max, value) | uint8_t chint32_t minint32_t maxint32_t value | void | Converts a user integer value to the 4~20mA output range. |
Example
IanalogWrite2(0, 0, 100, 50); // Approx. 12mA IanalogWrite2f(1, 0.0F, 10.0F, 2.5F); // Approx. 8mA
Precautions
- Match the module DIP switches, external power supply and output range.
- Do not configure these together with PWM functions sharing the same timer.
- Do not output values to uninitialized channels.
- Currently, MPAINO Y analog output supports channels up to
0~11; do not use12~15. analogWriteInit(),analogWriteFreq()andanalogWriteMax()are for Y analog output channels and must not be used for high-speed pulse channels20~31.- Do not use high-speed pulse GPIO numbers
130~141withanalogWrite().
en-us_commands/reference/ianalogwrite2.1788785566.txt.gz · Last modified: by 127.0.0.1
