Home › Forums › Forums › Technical Support for BerryIMU › BerryIMU and Matlab › Reply To: BerryIMU and Matlab
Mark,
Thanks for the spread sheet, so based on the spread sheet I am not getting all the correct data results for each of the processes.
here is the solution I’m using.
function [ acc_combined ] = readACCx(a)
acc_low = readRegister(a, hex2dec(’28’));
acc_high = readRegister(a, hex2dec(’29’));
acc_low = int16(acc_low);
acc_high = int16(acc_high);
acc_combined = bitor(acc_low, bitshift(acc_high, 8));
fprintf(‘ACCx low: %8.2f high: %8.2f pre-combined: %8.2f post-combined: ‘, acc_low, acc_high, acc_combined);
if acc_combined >= 32768
acc_combined = acc_combined – 65536;
end
fprintf(‘%8.2f\n’,acc_combined);
end
once again thank you for your help. I’m now going to run the entire script and verify that I’m getting the correct pitch and roll. As that’s ultimately the data I need for my project. Thank you again!!