HID Core , keyboard availability question

Can i use keyboard.write with spark core ?

I know arduino uno can not do it , leonardo only can do that . but what about spark core ?

Having tried the “search” option, this came up: https://community.spark.io/t/usb-hid-support-on-core/
Perhaps you’ll find some more information there, and if not, you can at least ask the responsible people.

@Gentmat, I’ve mainly been playing with HID Mouse on the Core and this works quite nicely.
About the HID Keyboard support, it’s still quite rudimentary.
You can Keyboard.write() but only one character/key at a time and if you want to use other than US keyboard layout, you may have to alter some key mappings.

AFAIK, to use it, you’ll still have to build locally.

As I have not used vanilla Arduino HIDs but Teensy, I’m not sure what the Arduino has to offer, but I’m missing Teensy’s multi HID support (Mouse + Keyboard + Serial), absolute mouse (like digitizer tablets) and to Keyboard.write()/.print() whole strings (while this last one would be easy to add yourself, by using the already available functions).

"I’ve mainly been playing with HID Mouse on the Core and this works quite nicely. "
what library or code you used to play with mouse ?
any example please

It’s not a library but a branch of the core-firmware
So you have to fork/clone this branch, write your own application.cpp, build that firmware and upload it to the Core.
@satishgn has done a great job putting this together and he might have some idea if/when this feature might make it into compile-server2 for WebIDE use.

Hate to resurrect an old thread but @ScruffR would you mind sharing your application.cpp/.h that you have been using to test this feature? I know how to pull down the HID branch but I’m not quite sure how to use it

@harrisonhjones, sure thing.
I’ve only been testing the keyboard feature very briefly. I mainly focused on the mouse capabilities, so I only have a “cloud mouse” application.cpp.
But once you figured out how this one works the keyboard thingy will be a piece of cake :wink:

You can download my application.cpp from my Dropbox

I’ve also written a C# program to control this “cloud mouse” from my tablet - the cloud lags a bit, but it’s fun :smile:

Edit: One thing I forgot to mention. In main.h you need to alter this

//#define SPARK_USB_SERIAL
#define SPARK_USB_MOUSE
//#define SPARK_USB_KEYBOARD

Since we are at reviving things ;-):
I’d still like to see the Core to be able to act as a composite device (Mouse AND Keyboard AND Serial (AND MassStorageDevice if possible) AND …) - at the moment it’s only exclusive OR.
Also an “Absolute Mouse” (like digitizer tablet) would be useful.

Maybe others could aswell vote for this enhancement there


and/or

1 Like

If we could get even rudimentary massstoragedevice to work I would be so happy. We could configure the damn wifi settings using it! Think of how easy it would be to setup the device! No more serial terminals!!!

1 Like

I’m new to Particle but have been involved in programming with Ardunio and Teensy. Re absolute Mouse.MoveTo(), Teensy has implemented this ‘out of the box’ meaning, if you are using a Teensy, then you have this feature, no includes or libraries to pull in.

Ardunio on the other hand, does NOT have absolute mouse move (it has relative mouse move) and they are not sure how to implement it IF they were going to add it. I get the feeling from reading their replies that they don’t have much interest in adding this feature.

The point of all of this is: Mouse.MoveTo() CAN be implemented (by that I mean it is possible, not impossible) because the Teensy folks have done it. Again, I am new around here and don’t know the major players/developers or how new things get done, but if Particle were to implement it as a new feature, you folks would be ahead of the Ardunio camp in that respect.

BTW the BIGGEST (by far) feature Particle has over BOTH Ardunio and Teensy is your remote flashing capability. This community (Ardunio, Teensy) primarily thinks in terms of using their boards for home projects, local projects. They don’t have a mind set about deploying code ‘into the field’ and then having to support it with updates. For those who are building projects to sell and need an easy way to update their code after deployment, Particle is THE solution.

1 Like