🤖 Droids You Are Looking For - A Node.js Library to interact with Sphero droids
MIT License
A Node.js Library to interact with Star Wars Sphero droids
To pair droids with your device for the first time, you need an external tool to find UUID. I use
node blescanner.js
included in this library.
const dyalf = require('./dyalf');
let r2 = new dyalf.R2D2('4bef2b0786334e2fac126c55f7f2d057');
let main = async () => {
await r2.connect();
await r2.openCarriage();
await r2.closeCarriage();
await r2.sleep(1000);
await r2.animate(7);
for (var i = -160; i < 180; i += 5) {
await r2.rotateTop(i);
}
await r2.sleep(1000);
await r2.off();
dyalf.shutdown();
};
main();
Use @abandonware/noble npm package to avoid the xpc-connection error.
Restart your Mac is a valid option! Alternatively:
rm -v ~/Library/Preferences/ByHost/com.apple.Bluetooth.*.plist
sudo rm /Library/Preferences/com.apple.Bluetooth.plist
You can automate this procedure using blueutil:
blueutil off
rm -v ~/Library/Preferences/ByHost/com.apple.Bluetooth.*.plist
sudo rm /Library/Preferences/com.apple.Bluetooth.plist
blueutil on
MIT - Copyright (c) Andrea Stagi