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

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 20563

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>