Swap reading y and z values (#2137)

This commit is contained in:
Suraj151 2017-10-16 18:21:24 +05:30 committed by Marcel Stör
parent ec6ed6f868
commit aebfd1a907
1 changed files with 2 additions and 2 deletions

View File

@ -96,8 +96,8 @@ static int hmc5883_read(lua_State* L) {
platform_i2c_send_stop(hmc5883_i2c_id);
x = (int16_t) ((data[0] << 8) | data[1]);
y = (int16_t) ((data[2] << 8) | data[3]);
z = (int16_t) ((data[4] << 8) | data[5]);
z = (int16_t) ((data[2] << 8) | data[3]);
y = (int16_t) ((data[4] << 8) | data[5]);
lua_pushinteger(L, x);
lua_pushinteger(L, y);