Help with mouse library

It says "'Mouse' not found. Does your sketch include the line '#include <Mouse.h>'?

Thank you all !

Here is the code:
https://pastebin.com/raw/kMbbZEQS

(deleted)

The link is just raw but is ok :slight_smile: im using nano
HERE is the code:

#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;
int button1 = 6;
int button2 = 7;
int buttonState1 = 0;
int buttonState2 = 0;

void setup() {

Serial.begin(9600);
Wire.begin();
pinMode(button1, INPUT);
pinMode(button2, INPUT);
mpu.initialize();
if (!mpu.testConnection()) { while (1); }
}

void loop() {
mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

vx = (gx+15)/150;
vy = -(gz-100)/150;

Serial.print("gx = ");
Serial.print(gx);
Serial.print(" | gz = ");
Serial.print(gz);

Serial.print(" | X = ");
Serial.print(vx);
Serial.print(" | Y = ");
Serial.println(vy);

Mouse.move(vx, vy);

buttonState1 = digitalRead(button1);
buttonState2 = digitalRead(button2);

if (buttonState1 == HIGH) {
Mouse.press(MOUSE_LEFT);
delay(100);
Mouse.release(MOUSE_LEFT);
delay(200);
}
else if(buttonState2 == HIGH) {
Mouse.press(MOUSE_RIGHT);
delay(100);
Mouse.release(MOUSE_RIGHT);
delay(200);
}
delay(80);
}

You can only use the Mouse and Keyboard libraries with the Arduino boards that have native USB (Leonardo, Pro Micro, Micro, Zero, MKR, Due). You cannot use it with the Nano, Uno, Mega, or Pro Mini. This is the cause of the error. If you want to use the Mouse library, you'll need to buy a different Arduino board that's compatible with it.