Douglas6 wrote: ↑Tue Apr 23, 2019 6:30 pm
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.
Code: Select all
#include <Wire.h>
#include <I2Cdev.h>
#include <MPU6050.h>
#include <Mouse.h>
MPU6050 mpu;
int16_t ax, ay, az, gx, gy, gz;
int vx, vy, vx_prec, vy_prec;
int count=0;
void setup() {
Serial.begin(9600);
Wire.begin();
mpu.initialize();
if (!mpu.testConnection()) {
while (1);
}
}
void loop() {
mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
vx = (gx+300)/200; //
vy = -(gz-100)/200; //
Mouse.move(vx, vy);
}
this is the code i have burned to arduino for making the air mouse when connected through wire it works fine how do i perform the same function wireless using hc-05 module should i make any changes in the code ?? I tried the method suggested above but i am not able to work using it.
update: i have connected it via serial connection on rfcomm0 and in bluetooth section it shows device can be used.
Thank you in advance.