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

A motor and a servo doesn't work #39

Closed
reconbot opened this issue Oct 16, 2014 · 2 comments
Closed

A motor and a servo doesn't work #39

reconbot opened this issue Oct 16, 2014 · 2 comments

Comments

@reconbot
Copy link
Contributor

So using my handy pulse counting arduino, I can confirm that, this will only drive the servo. But if you comment out the servo, the motor works fine.

board.on('ready', function(){

  var motor = new five.Motor({
    pins: {
      pwm: "A0",
      dir: "D0",
      cdir: "D1"
    }
  });

  var servo = new five.Servo({
    pin:"A1"
  });

  this.repl.inject({
    s: servo,
    m: motor
  });

});
@reconbot
Copy link
Contributor Author

With some more research I have figured out the following.

  • The spark has a debug output
  • Not all cores have this problem
  • This is probably an issue with voodoo-spark or the core and not spark-io. I see the commands recieved on the core itself from it's debug output

This is m.fwd(200) in the repl

--------------PROCESSING NEW DATA--------------
----------processInput----------
Bytes Available: 3
0: 2
1: 10
2: 0
Bytes Expecting: 3
Bytes Read: 3
Action received: 2
Cached: 02
Cached: 110
Cached: 20
PIN received: 10
VALUE received: 0
--------------PROCESSING NEW DATA--------------
----------processInput----------
Bytes Available: 9
0: 1
1: 1
2: 0
3: 1
4: 0
5: 1
6: 2
7: 10
8: 200
Bytes Expecting: 3
Bytes Read: 9
Action received: 1
Cached: 01
Cached: 11
Cached: 20
PIN received: 1
VALUE received: 0
# Unprocessed Bytes: 6
----------processInput----------
Bytes Available: 6
0: 1
1: 0
2: 1
3: 2
4: 10
5: 200
Bytes Expecting: 3
Bytes Read: 6
Action received: 1
Cached: 01
Cached: 10
Cached: 21
PIN received: 0
VALUE received: 1
# Unprocessed Bytes: 3
----------processInput----------
Bytes Available: 3
0: 2
1: 10
2: 200
Bytes Expecting: 3
Bytes Read: 3
Action received: 2
Cached: 02
Cached: 110
Cached: 2200
PIN received: 10
VALUE received: C8

If I'm reading this correctly

  • A0 goes to 0
  • D1 goes to 0
  • D1 goes to 1
  • A0 goes to C8 (or 200 like I asked it to)

However there are no pulses coming from A0

@reconbot
Copy link
Contributor Author

I can now confirm that the precompiled voodoospark that comes with the spark-cli works fine - the latest master of voodoospark however has this issue. I'll reopen this over there.

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