Arduino took over mouse, help!

I have a button and when pressed, it should do a ""

Accidentally I have written a code that clicks all the time so whenever I connect the arduino (micro) to computer, it keeps clicking and I cannot upload code again to the board because it clicks everywhere...

I have clicked the reset button on Arduino but it does not work. I does not delete the code inside...

So what should I do? I need help ASAP... Thanks...

:confused: :confused: :confused:

Unplug the Arduino? Upload a blank sketch to the board?

The reset button does not delete the code, it's just like a reboot.
Keep the reset button pressed, then connect to the PC, Upload another sketch, release the reset button ~1-3s after clicking "upload".

You might need some tries, timing is a bit tricky, but it works.

lg, couka

Please do not double post.

Thanks but I cannot upload another sketch because I need to choose the port before uploading. The problem is I cannot choose the port than click upload... :-[

@hutkikz, the subjects are totally different in those posts. That's why I wanted to post differently...

What happens when you unplug the Arduino?

The problem is I cannot choose the port than click upload... :-[

You can choose the port even while pressing reset.

lg, couka

Ok, problem is solved,

I had buttons, and if pressed they should click the mouse, my code was wrong. It was clicking all the time when the buttons were not pressed. So to stop clicking, I simply clicked the buttons. :slight_smile:

But so strange anyway, there should be a way to reset arduino... I was lucky to have the buttons, I think if I didn't have the buttons, I would not be able to reset the arduino again...

Do you even read the replies?

lg, couka

Thanks guys. I saw the warnings before starting to code, but I thought it wouldn't be that important...

Anyway, always program in a failsafe.

I don’t see a need for that. It’s hardly possible to accidentally write a sketch that keeps you from overwriting it. Also, if your sketch doesn’t do what you thought it would do, chances are the failsafe does not help.

We’re talking about an arduino sketch, not the Red Queen, lol :smiley:

lg, couka