You'll need to configure the Serial Port Profile on the Pi, and create a virtual serial device using rfcomm. There are instructions in this forum which a search should reveal. #include <Wire.h> #include <I2Cdev.h> #include <MPU6050.h> #include <Mouse.h> MPU6050 mpu; int16_t ax, ay, az, gx, gy, gz; ...