フィルターのクリア

Converting ADC data to voltage

2 ビュー (過去 30 日間)
ECEdesigner
ECEdesigner 2016 年 6 月 12 日
回答済み: ECEdesigner 2016 年 7 月 17 日
I am trying to manipulate the data received from my TI ADS1220 using Arduino and MATLAB. I get readings from the Arduino (using arduino toolbox) in the form of 3 bytes in 2's complement form (MSB, DATA, LSB).
I need to shift these bytes into a larger byte and then convert that to a voltage. Here is what I have tried when combining the bytes. From the examples I looked out it looks like I want to shift this into a 32 bit number but I'm not exactly sure why.
[bit]= writeRead(ADS1220, [RDATA,hex2dec('FF'), hex2dec('FF'),hex2dec('FF')]);
bit(:,1) =[]; %delete first bit
voltage = double(bitor((bitshift(uint8(dec2bin(bit(1))), 8)), bit(2)));
voltage2 = double(bitor((bitshift(voltage, 8)), bit(3)));

採用された回答

ECEdesigner
ECEdesigner 2016 年 7 月 17 日
Resolved issue

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by