{"action":"created","issue":{"url":"https://api.github.com/repos/rwaldron/johnny-five/issues/959","labels_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/959/labels{/name}","comments_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/959/comments","events_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/959/events","html_url":"https://github.com/rwaldron/johnny-five/issues/959","id":116194940,"number":959,"title":"Motor: some commands skipped","user":{"login":"cescopag","id":2178865,"avatar_url":"https://avatars.githubusercontent.com/u/2178865?v=3","gravatar_id":"","url":"https://api.github.com/users/cescopag","html_url":"https://github.com/cescopag","followers_url":"https://api.github.com/users/cescopag/followers","following_url":"https://api.github.com/users/cescopag/following{/other_user}","gists_url":"https://api.github.com/users/cescopag/gists{/gist_id}","starred_url":"https://api.github.com/users/cescopag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cescopag/subscriptions","organizations_url":"https://api.github.com/users/cescopag/orgs","repos_url":"https://api.github.com/users/cescopag/repos","events_url":"https://api.github.com/users/cescopag/events{/privacy}","received_events_url":"https://api.github.com/users/cescopag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-11-10T20:29:29Z","updated_at":"2015-11-12T07:03:52Z","closed_at":null,"body":"Hi everyone, i'm having weird problems trying to control two motors with Arduino and J5.\r\nI'm using a L293D chip as motor driver with external power input.\r\nI'm testing this simple script:\r\n\r\n    var motorA, motorB;\r\n    var five = require('johnny-five');\r\n    var board = new five.Board();\r\n    board.on('ready', start);\r\n\r\n    function start() {\r\n\r\n    \tmotorA = new five.Motor({\r\n    \t\tpins:{\r\n    \t\t\tpwm: 6,\r\n    \t\t\tdir: 3,\r\n    \t\t\tcdir: 2\r\n    \t\t}\r\n    \t});\r\n    \t\r\n    \tmotorB = new five.Motor({\r\n    \t\tpins:{\r\n    \t\t\tpwm: 9,\r\n    \t\t\tdir: 5,\r\n    \t\t\tcdir: 4\r\n    \t\t}\r\n    \t});\r\n    \t\r\n    \tboard.repl.inject({\r\n    \t\ta:motorA,\r\n    \t\tb:motorB\r\n    \t});\r\n    }\r\n\r\nWhen I try to turn motors on/off, some commands are somewhat ignored.\r\nFor example, I've just tried to type these commands:\r\n\r\na.forward() -> the motor A starts correctly\r\nb.forward() -> the motor B starts correctly\r\na.stop() -> motor A stops correctly\r\nb.stop() -> nothing happens, motor B still running\r\nThen, I pressed arrow up and the B motor suddenly stopped!\r\n\r\nI tried several times with different sequences and it happens quite regularly. In particular, stop commands seems to work better than forward commands...\r\nThe weird thing is that Arduino RX led blinks correctly every time, but some messages are just ignored and ~~received~~ executed by Arduino only when I press any key (sometimes 2-3 keystrokes are needed).\r\n\r\nI'm quite sure the hardware part is fine, I wrote a test program with just the Arduino IDE that uses raw pin commands and motors work fine.\r\nThe only difference I can think about is that in my test program I set the serial port at 9600 baud.\r\n\r\nAny ideas on what's going on?"},"comment":{"url":"https://api.github.com/repos/rwaldron/johnny-five/issues/comments/156019346","html_url":"https://github.com/rwaldron/johnny-five/issues/959#issuecomment-156019346","issue_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/959","id":156019346,"user":{"login":"cescopag","id":2178865,"avatar_url":"https://avatars.githubusercontent.com/u/2178865?v=3","gravatar_id":"","url":"https://api.github.com/users/cescopag","html_url":"https://github.com/cescopag","followers_url":"https://api.github.com/users/cescopag/followers","following_url":"https://api.github.com/users/cescopag/following{/other_user}","gists_url":"https://api.github.com/users/cescopag/gists{/gist_id}","starred_url":"https://api.github.com/users/cescopag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cescopag/subscriptions","organizations_url":"https://api.github.com/users/cescopag/orgs","repos_url":"https://api.github.com/users/cescopag/repos","events_url":"https://api.github.com/users/cescopag/events{/privacy}","received_events_url":"https://api.github.com/users/cescopag/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T07:03:52Z","updated_at":"2015-11-12T07:03:52Z","body":"Ok it prints both log lines immediately after each command every time, and nothing when I tap on the keyboard...\r\n\r\nIn this screenshot the a.forward() didn't turn the led on, but you can see the logs just after the a.forward()\r\nhttps://www.dropbox.com/s/5leyj8nxx8v7tzz/Screenshot%202015-11-12%2007.54.46.png?dl=0\r\n"}}