Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20696

BASCOM-AVR : Wish: Make Getadc return signed values : REPLY

$
0
0
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

Viewing all articles
Browse latest Browse all 20696

Trending Articles