/* output to DAC word works like: 0xFF -> +10 V 0x00 -> 0 V */ /* there is NO negative. You can invert the signal with an external signal into the post-DAC amplifier, but the software is completely unaware of that */ dc = (long) ((*(pg->value) / pg->scale) * 0xFF); if (dc > 0xff) { dc = 0xff; } if (dc < 0 ) { dc = 0; }