Help with Pro Micro

I have just attached a Pro Micro to my Mega2560.
I am turning a monitor into a touch screen using ultra sonic sensors. By using the distances from the sensors, I will create an X and Y coordinate system, then move my mouse to that location.

I get this error message:

exit status 1
‘Mouse’ not found. Does your sketch include the line ‘#include <Mouse.h>’?

I actually do have the line #include <Mouse.h>

Maybe there is an error with the way I connected the Pro Micro the the Mega2560. Here is the code i have so far. I cant upload photos of the wiring, because the image size is too large. Maybe i could send it via Email

If you have any ideas, please let me know.

Array_Of_6_Ultrasoic_Sensors_12-27-2018.ino (8.26 KB)

You don't have a Mouse.begin() statement. Look at the Mouse examples in the Reference section

Also, heed the warnings about getting stuck in Mouse mode

...R

Heres what I get now:

exit status 1
‘upButton’ was not declared in this scope

Im thinking that its because I connected my Pro Micro to my Mega2560 incorrectly, because the light on my Pro Micro does not turn on.

This is what the wiring looks like:
Mega [TX3 14] is connected to Pro Micro [RX1]
Mega [RX3 15] is connected to Pro Micro [TX0]

I have the Mega connected to my desktop

I attached a new copy of my code as well.

Array_Of_Ultrasoic_Sensors_12-29-2018.ino (9.01 KB)

Diamond_Ice: Heres what I get now:

exit status 1 'upButton' was not declared in this scope

Im thinking that its because I connected my Pro Micro to my Mega2560 incorrectly,

No it's not. It is because you are trying to use a variable before you have declared it. Look at all the declaration before setup(). Do you see upButton among them? Or downButton or ...

However, apart from line 42 upButton does not seem to be used anywhere - so maybe just delete line 42

Also you have several lines of lost code after the closing } for setup(). The closing } is in the wrong place.

...R

I appreciate all the responses and suggestions.

Im quite new to coding, so could you refer me to someone who can help write the code for me?

Thanks so much

Diamond_Ice: Im quite new to coding, so could you refer me to someone who can help write the code for me?

You should post a request in the "Gigs and Collaborations" section of the forum. Don't forget to say how much you are willing to pay.

Diamond_Ice: could you refer me to someone who can help write the code for me?

If you are interested in learning to program I suggest you start with a much simpler program. Look at some of the examples that come with the Arduino IDE. Make copies of them and try altering them a little bit.

And there are very many online tutorials about Arduinos and about C programming in general.

...R