firmata / arduino

Firmata firmware for Arduino
GNU Lesser General Public License v2.1
1.53k stars 515 forks source link

Pyfirmata and arduino leonardo mouse and keyboard abilities #489

Closed aconitium closed 2 years ago

aconitium commented 2 years ago

I've been dying to figure this out. I'm very inexperienced with microcontrollers so please pardon my cluelessness. In the arduino IDE the arduino leonardo has the capability to take control of your mouse and keyboard and emulate clicks, movements, and button presses for both. I'm not too sure as for how to use pyfirmata yet, but I haven't found any info on using the equivalent of mouse.move() and other related functions with pyfirmata, is this possible, and if so, how? I do have a usb host shield at hand if needed. Thanks!

pgrawehr commented 2 years ago

@vexzyfr Firmata is intended to control hardware that's attached to the arduino from your PC. What you're trying to do is control the PC from the Arduino. Of course it's possible to create an extension to firmata (or rather, ConfigurableFirmata) to use the keyboard/mouse interfaces to do stuff, but this seems a bit pointless. Why would you want to use the PC to tell the Arduino to hit keys so that the PC does something?

What is it you're trying to do at the end of the day?

aconitium commented 2 years ago

I won't bother you with the details as the project is relatively pointless as you said, I'm just really determined to figure this out. Thanks for the reply, I found a solution using pyserial.