All pastes #228662 Raw Edit

Stuff

public text v1 · immutable
#228662 ·published 2006-10-30 05:29 UTC
rendered paste body
    /* 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;
	}