Library containing Crazyflie 2.0 sensors drivers: - LPS25H (barometer) - MPU9250 (IMU) - PMW3901 (optical flow) - VL53L0X (range)
Dependents: Drones-Controlador controladoatitude_cteste Drone_Controlador_Atitude optical_test
Diff: PMW3901/PMW3901.cpp
- Revision:
- 15:e07de535b86f
- Parent:
- 14:e4d638ac83af
diff -r e4d638ac83af -r e07de535b86f PMW3901/PMW3901.cpp --- a/PMW3901/PMW3901.cpp Thu Sep 27 17:57:28 2018 +0000 +++ b/PMW3901/PMW3901.cpp Wed Oct 17 13:26:29 2018 +0000 @@ -176,11 +176,11 @@ spi.write(DELTA_Y_H & 0b01111111); data[3] = spi.write(0x00); // Reassemble the data (two 8 bit data into one 16 bit data) - int16_t x_raw = (data[1] << 8 ) | data[0]; - int16_t y_raw = (data[3] << 8 ) | data[2]; + int16_t px_raw = (data[1] << 8 ) | data[0]; + int16_t py_raw = (data[3] << 8 ) | data[2]; // Convert to SI units [px] - x = -y_raw * 1.0f; - y = -x_raw * 1.0f; + px = -py_raw * 1.0f; + py = -px_raw * 1.0f; // Deselect the device by seting chip select high cs = 1;