Shouldn't 1 additional line of code solve the problem?
DIM ADC_DIF as INTEGER
ADC_DIF = GETADC(differential_channel)
If Adc_dif.9 = 1 Then 'Test for negative Result
Adc_dif = Adc_dif Or &B1111110000000000 'Set 6 MSB, so that a 16bit Integer variable is interpreted correctly
End If
Kind regards
Roger
↧