SamuZai
Pybricks
Pybricks

patreon


Wireless communication between Spike Prime hubs

One of our newest members asked how to communicate between two Spike Prime hubs to control a car-like vehicle with one steering motor and two drive motors.

Fortunately, this works the same on any hub! This means you can combine any of the car tutorials with the wireless communication tutorial to build Spike Prime cars, too!

How it works

The two programs above illustrate how this works. One hub just broadcasts it pitch and roll values in a loop.

Any hub can receive these values, including a Spike powered car. The car can use the pitch for drive power and roll for steering. I've also added two math blocks to multiply the tilt values, so it steers a bit faster even for small amounts of tilt.

Further exploration

Pitch and roll are easy ways to get started, but can you think of more creative ways for drive power and steering input? Maybe you can...

Wireless communication between Spike Prime hubs Wireless communication between Spike Prime hubs

Comments

Great, thank you! 🙏

Sofia M


More Creators