Hover Gesture Sensor data from one Photon, sent to a second Photon controlling servos

Hey particle community!

I’m a high school robotics teacher and I’m developing my curriculum for a particle photon unit! So excited to get these kids going. I have a class set of the Hover Labs “Hover” gesture sensor I use later in the year to do things like control servo robotic arms with gestures. I have a ton of Arduino projects for it, but I’m working on one for the photon.

What I’d like to do is use one photon to take in the raw X and Y coordinates from the gesture sensor, and send it to another photon controlling 2 servos for a little robot. I can get the X and Y no problem, just looking for suggestions in using particle.publish for sending two sets of int’s that are changing, then reading those two sets of int’s in particle.subscribe on a second photon.

Long story short, working on developing a wireless gesture powered remote control for a little bot!

1 Like

I think the problem you’ll have is the publishing limit of 1 per second (with a burst of 4 per second allowed, but with a delay before you can publish again). If you can live with that limitation, then publishing should be fine. I don’t know what specific advice you want. The payload has to be a string, so you could combine the two ints into a string, and send them that way.

How much time will be between the two sets of ints?
If these are just the start and finish coordinates of the gesture, you may even only need one publish with all four ints and you could parse the string with sscanf() (which works well for ints)