Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with Sphero #16

Open
panther99 opened this issue Dec 17, 2017 · 0 comments
Open

Doesn't work with Sphero #16

panther99 opened this issue Dec 17, 2017 · 0 comments

Comments

@panther99
Copy link

panther99 commented Dec 17, 2017

No matter what I try, I can't control Sphero with cylon-keyboard. Everything works well when I use one of them, but when I try to use both I get this output;

2017-12-17T11:08:30.179Z : [Robot 1] - Starting connection 'keyboard'.
2017-12-17T11:08:30.197Z : [Robot 1] - Starting connection 'sphero' on port /dev/tty.Sphero-RWP-AMP-SPP.
The method Logger#info has been deprecated.
It will be removed in Cylon 2.0.0.
Please switch to using the #log or #debug Logger methods
2017-12-17T11:08:30.200Z : Connecting to Sphero 'sphero'...
2017-12-17T11:08:31.549Z : [Robot 1] - Starting devices.
2017-12-17T11:08:31.549Z : [Robot 1] - Starting device 'keyboard'.
2017-12-17T11:08:31.551Z : [Robot 1] - Starting device 'sphero'.
/Users/apple/Development/riseofsphero/node_modules/cylon-sphero/lib/driver.js:38
  this.connection.setTempOptionFlags(0x01);
                  ^

TypeError: this.connection.setTempOptionFlags is not a function
    at Driver.start (/Users/apple/Development/riseofsphero/node_modules/cylon-sphero/lib/driver.js:38:19)
    at Robot.startDevice (/Users/apple/Development/riseofsphero/node_modules/cylon/lib/robot.js:368:16)
    at Robot.<anonymous> (/Users/apple/Development/riseofsphero/node_modules/cylon/lib/robot.js:339:19)
    at /Users/apple/Development/riseofsphero/node_modules/cylon/lib/utils/helpers.js:237:36
    at Array.forEach (native)
    at Object.parallel (/Users/apple/Development/riseofsphero/node_modules/cylon/lib/utils/helpers.js:237:13)
    at Robot.startDevices (/Users/apple/Development/riseofsphero/node_modules/cylon/lib/robot.js:343:12)
    at next (/Users/apple/Development/riseofsphero/node_modules/cylon/lib/utils/helpers.js:266:22)
    at callback (/Users/apple/Development/riseofsphero/node_modules/cylon/lib/utils/helpers.js:262:5)
    at callback (/Users/apple/Development/riseofsphero/node_modules/cylon/lib/utils/helpers.js:231:7)
    at Adaptor.<anonymous> (/Users/apple/Development/riseofsphero/node_modules/cylon-sphero/lib/adaptor.js:74:7)
    at /Users/apple/Development/riseofsphero/node_modules/sphero/lib/sphero.js:127:7
    at SerialPort.<anonymous> (/Users/apple/Development/riseofsphero/node_modules/sphero/lib/adaptors/serialport.js:71:5)
    at emitNone (events.js:86:13)
    at SerialPort.emit (events.js:185:7)
    at /Users/apple/Development/riseofsphero/node_modules/sphero/node_modules/serialport/lib/serialport.js:227:10

Source:

const Cylon = require('cylon');

var spheroSettings = {
  port: '/dev/tty.Sphero-RWP-AMP-SPP',
  speed: 120
};

Cylon.robot({
  connections: {
    keyboard: { adaptor: 'keyboard' },
    sphero: { adaptor: 'sphero', port: spheroSettings.port }
  },

  devices: {
    keyboard: { driver: 'keyboard' },
    sphero: { driver: 'sphero' }
  },

  work: function(my) {
    my.keyboard.on('a', function(key) {
      my.sphero.roll(120, 90);
    });
   }
}).start();
@panther99 panther99 changed the title Sphero and cylon-keyboard don't play well together Doesn't work with Sphero Dec 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant