Im new to Arduino, and i have recently wanted to make the joystick that comes with the Plusivo kit (Yes its not an Arduino product , but it has the same capabilities as an Arduino, it even uses the same text editor in which case is "Arduino IDE" ) and turn it into a mouse sort of thing .
This is my code:
#include <Mouse.h>
const int switchPin = 2;
const int mouseButton = 3;
const int xAxis = A0;
const int yAxis = A1;
const int ledPin = 5;
int range = 12;
int responseDelay = 5;
int threshold = range / 4;
int center = range / 2;
bool mouseIsActive = false;
int lastSwitchState = LOW;
void setup() {
pinMode(switchPin, INPUT);
pinMode(ledPin, OUTPUT);
Mouse.begin();
}
void loop() {
// put your main code here, to run repeatedly:
}
The error is :Compilation error: "'Mouse' not found. Does your sketch include the line '#include <Mouse.h>'?"
The code is not yet finished as you can see , but thats not the problem .
The problem is that why cant i use "Mouse" if the library is included ? If its an easy solution please tell me.
You will need to install the Mouse library. In the Arduino IDE, go to Tools -> Manage Libraries, and do a search for "mouse". It should list Mouse by Arduino, click "Install".
Hello.
Thanks for replying .
When i look at my board , it just says Plusivo , no exact name . Ive also looked at the website of the creators of the board , and it says its called just "Plusivo Microcontroller Board"
No, this won't help to compile the code for Uno board. The library is not compatible with Uno.
You need a board with native USB support, for example Arduino Micro