You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello dear Asukiaaa, first of all congratulate you for this great library that you have provided us !!!
I have used it to create an Air mouse with mpu9250 and it works great but I know that the movement could still be improved a little more, for example, the movements are linear, it means that it is easier to draw a square than a circles, I do not know if I explain myself ...
On the other hand, in this code that I send you, I only use the gyroscope, since I don't know how to implement the accelerometer and magnetometer so that the accelerometer, gyroscope and magnetometer compensate each other and correct any drift that may occur.
And last, its there any autocalibration for the gyro and the accel when the Arduino start?
Or do i have to implement it with any code?
Any help or advice you can provide will be of great help dear Asukiaaa.
Thanks in advance :)
ARDUINO SKETCH
#include <MPU9250_asukiaaa.h>
#include <Mouse.h>
#define SDA_PIN 21
#define SCL_PIN 22
#define A18_PIN 16
#define A19_PIN 17 //STOP MOUSE MOVEMENT WHILE HOLDING
Hello dear Asukiaaa, first of all congratulate you for this great library that you have provided us !!!
I have used it to create an Air mouse with mpu9250 and it works great but I know that the movement could still be improved a little more, for example, the movements are linear, it means that it is easier to draw a square than a circles, I do not know if I explain myself ...
On the other hand, in this code that I send you, I only use the gyroscope, since I don't know how to implement the accelerometer and magnetometer so that the accelerometer, gyroscope and magnetometer compensate each other and correct any drift that may occur.
And last, its there any autocalibration for the gyro and the accel when the Arduino start?
Or do i have to implement it with any code?
Any help or advice you can provide will be of great help dear Asukiaaa.
Thanks in advance :)
ARDUINO SKETCH
#include <MPU9250_asukiaaa.h>
#include <Mouse.h>
#define SDA_PIN 21
#define SCL_PIN 22
#define A18_PIN 16
#define A19_PIN 17 //STOP MOUSE MOVEMENT WHILE HOLDING
MPU9250_asukiaaa mySensor;
float aX, aY, aZ, aSqrt, gX, gY, gZ, mDirection, mX, mY, mZ;
int vx, vy;
void setup() {
Serial.begin(115200);
Wire.begin(SDA_PIN, SCL_PIN);
pinMode (A18_PIN, INPUT_PULLUP);
pinMode (A19_PIN, INPUT_PULLUP);
mySensor.beginGyro();
Mouse.begin();
}
void loop() {
if (digitalRead(A19_PIN) == HIGH) {
mySensor.gyroUpdate();
gX = mySensor.gyroX();
//gY = mySensor.gyroY();
gZ = mySensor.gyroZ();
vx = (gX + 0) / 5;
vy = (gZ + 0) / 5;
Mouse.move(-vx, -vy);
}
{
if (digitalRead(A18_PIN) == HIGH) {
Mouse.press(MOUSE_LEFT);
}
The text was updated successfully, but these errors were encountered: