function [gx gy gz gt] = readGyro(out, calCo) fprintf(out.s,'G'); readings(1) = fscanf(out.s,'%f'); readings(2) = fscanf(out.s,'%f'); readings(3) = fscanf(out.s,'%f'); temp = fscanf(out.s,'%f'); offset = calCo.offset; gain = calCo.g; gyro = (readings - offset) ./gain; gx = gyro(1); gy = gyro(2); gz = gyro(3); gt = temp; end