Skip to content

servo example not working #21

@hiattp

Description

@hiattp

Love this framework. led.blink() works fine, but I can't get my servo to respond. The servo sweep example that comes with the arduino software works well so I don't think its the servo. Here is what I'm seeing in the log:

1337133106943 duino info attempting to find Arduino board
1337133106947 duino info set pin 13 mode to out
1337133106947 duino info serial not ready, buffering message: 0013001
Express server listening on port 3000 in development mode
1337133106957 duino info found board at /dev/tty.usbmodem411
1337133106957 duino info binding serial events
1337133107459 duino info board ready
1337133107459 duino info sending debug mode toggle on to board
1337133107465 duino write 9900001
1337133107467 duino info processing buffered messages
1337133107467 duino info writing buffered message
1337133107467 duino write 0013001
board ready, attaching servo { board:
{ debug: true,
writeBuffer: [],
_events: { ready: [Function], data: [Function] },
serial:
{ port: '/dev/tty.usbmodem411',
fd: 7,
readStream: [Object],
_events: [Object] } },
pin: '09',
_events: { attached: [Function] } }
1337133107469 duino write 980901


And then it stops. Thoughts? This is my code (pretty much straight from your example):

var arduino = require('duino'),
board = new arduino.Board({debug:true});

var led = new arduino.Led({
board: board,
pin: 13
});

var servo = new arduino.Servo({
board: board,
pin: 9
});

servo.on('attached', function(err) {
console.log('attached');

this.on('read', function(err, pos) {
console.log(pos);
});

this.on('detached', function(err) {
console.log('detached');
});

this.on('aftersweep', function(err) {
led.blink();

this.read();
this.detach();

});

this.sweep();
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions