@will the MPU6050 Library by electronic cats.
OK, thanks.
Anything seems possible when you don't know what you're talking about.
@gusmill33 I like the Adafruit library more.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@will Simple enough to delete them after, but to each his own.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@will Simple enough to delete them after, but to each his own.
The problem is identifying which ones were added. I don't want to zip the library beforehand so that I can restore it to its original state afterwards.
Anything seems possible when you don't know what you're talking about.
@will Just the MPU6050 library was used.
Well, I'm having problems because the IDE is telling me that Mouse is undefined. It seems that I'm missing the mouse code even after downloading it again from the repository.
I'm kind of stuck here now.
Edit - I've discovered that Mouse isn't available on all boards ...
Edit 2 - switched to Leonardo and can now compile (whew !)
Anything seems possible when you don't know what you're talking about.
@will Oh. I also believe I am using the USBHost library. Here https://github.com/arduino-libraries/USBHost . I am sorry I forgot to mention this earlier.
Edit - Alright if it is compiling then that works.
@will I just did a clean compile on an UNO
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
Here is a new sketch (called sketch0) for you to test. It reads the Myoware on analogue pin A0 and sends the appropriate mouse button messages.
Each time through the loop it reads the Myoware sensor and when that reading is from 300-500 it sends a mouse press left message to the PC; when the value os from 600-1000 it sends a mouse press right message to the PC; otherwise (i.e. not in a critical zone) it tests to see if the left or right button is pressed and, if so, releases it.
Hope this helps.
As an aside, you should be making lots of comments in your code. You know what you're doing now, but when you come back in a year to look at you'll wonder what was going on. As an example, check the comments in the module checkMouseButton.
It also helps you and anybody else who looks at your code to use meaningful names for modules and variables. If you see the module "fire()" you don't know whether to duck or get an extinguisher 🙂
Anything seems possible when you don't know what you're talking about.
@will I just did a clean compile on an UNO
So nice, so nice, we do it twice 🙂
Anything seems possible when you don't know what you're talking about.
@will Awesome! Thank you so much! I will test to see if everything works and check back here.
@will So as it seems right now the code is clicking at all times.
You'll remember that you said you wanted it to re-issue the mouse command each time through the loop.
If you only want it to click when entering for the first time, delete the 4 lines indicated in the sketch nd test again.
Anything seems possible when you don't know what you're talking about.