Compilation error: exit status 1}

i tried to connect arduino, and test it as a controller. this is the code:

#include "Mouse.h"

void setup()

{

pinMode(7, INPUT);

Mouse.begin();

}

void loop()

{

if (digitalRead(7) == HIGH) {

Mouse.click()

}

}

but for some reason, it doesen't work and sends me an error message

C:\Users\rverm\Documents\Arduino\lcd screen\lcd screen.ino: In function 'void setup()':
C:\Users\rverm\Documents\Arduino\lcd screen\lcd screen.ino:7:3: error: 'Mouse' was not declared in this scope
Mouse.begin();
^~~~~
C:\Users\rverm\Documents\Arduino\lcd screen\lcd screen.ino: In function 'void loop()':
C:\Users\rverm\Documents\Arduino\lcd screen\lcd screen.ino:13:1: error: 'Mouse' was not declared in this scope
Mouse.click()
^~~~~
Compilation error: exit status 1}

Hello steve131
Take a view here:

Have a nice day and enjoy coding in C++.

wait, in this it says"arduino leonardo, micro, or due" does it not work because I'm using arduino uno, or what?

Yes; you need a board with native USB.

It shows you that you should provide complete information :slight_smile:

===
Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.

i tried it on arduino leonardo with the same code, it still didn't work

Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum.

Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

You can go back and fix your original post by highlighting the code and clicking the </> in the menu bar.
code tags new

But you got a different error that you did not post.

C:\Users\sterretje\AppData\Local\Temp\arduino_modified_sketch_576321\sketch_jan20a.ino: In function 'void loop()':

sketch_jan20a:21: error: expected ';' before '}' token

   }

   ^

...
...
exit status 1
expected ';' before '}' token

So you're more-than-likely missing a semi-colon somewhere :wink:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.