{"action":"created","issue":{"url":"https://api.github.com/repos/hybridgroup/cylon-gpio/issues/33","labels_url":"https://api.github.com/repos/hybridgroup/cylon-gpio/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/hybridgroup/cylon-gpio/issues/33/comments","events_url":"https://api.github.com/repos/hybridgroup/cylon-gpio/issues/33/events","html_url":"https://github.com/hybridgroup/cylon-gpio/issues/33","id":42120991,"number":33,"title":"Servos will not switch directions when using a Spark Core","user":{"login":"occasl","id":486614,"avatar_url":"https://avatars.githubusercontent.com/u/486614?v=3","gravatar_id":"","url":"https://api.github.com/users/occasl","html_url":"https://github.com/occasl","followers_url":"https://api.github.com/users/occasl/followers","following_url":"https://api.github.com/users/occasl/following{/other_user}","gists_url":"https://api.github.com/users/occasl/gists{/gist_id}","starred_url":"https://api.github.com/users/occasl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/occasl/subscriptions","organizations_url":"https://api.github.com/users/occasl/orgs","repos_url":"https://api.github.com/users/occasl/repos","events_url":"https://api.github.com/users/occasl/events{/privacy}","received_events_url":"https://api.github.com/users/occasl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-09-06T16:59:20Z","updated_at":"2015-08-29T18:06:01Z","closed_at":null,"body":"I'm trying to write a simple cylon.js program to make a nodebot spin around in circles and alternating directions every second.  With the program below I get it to spin, but it will not alternate directions. The output in the console shows that it is attempting to switch the servos cw/ccw but the nodebot continues to go in one direction.\r\n\r\nThinking something was up with my servos, I verified this worked with JohnnyFive so I'm not sure why cylon.js won't work.\r\n\r\nAny ideas?\r\n\r\n```\r\nvar Cylon = require('cylon');\r\n\r\n// Initialize the robot\r\nCylon.robot({\r\n    connection: {\r\n        name: 'voodoospark',\r\n        adaptor: 'voodoospark',\r\n        accessToken: process.env.SPARK_TOKEN,\r\n        deviceId: process.env.SPARK_DEVICE_ID,\r\n        module: 'spark'\r\n    },\r\n    device: [\r\n        { name: 'leftwheel', driver: 'continuous-servo', pin: 'D0' },\r\n        { name: 'rightwheel', driver: 'continuous-servo', pin: 'D1' }\r\n    ],\r\n\r\n    work: function (my) {\r\n        var cw = true;\r\n\r\n        // turn right\r\n        my.devices.leftwheel.clockwise();\r\n        my.devices.rightwheel.counterClockwise();\r\n\r\n        every((1).second(), function () {\r\n            if (cw) {\r\n                my.devices.leftwheel.counterClockwise();\r\n                my.devices.rightwheel.clockwise();\r\n                cw = false;\r\n            } else {\r\n                my.devices.leftwheel.clockwise();\r\n                my.devices.rightwheel.counterClockwise();\r\n                cw = true;\r\n            }\r\n        });\r\n    }\r\n}).start();\r\n```"},"comment":{"url":"https://api.github.com/repos/hybridgroup/cylon-gpio/issues/comments/136020983","html_url":"https://github.com/hybridgroup/cylon-gpio/issues/33#issuecomment-136020983","issue_url":"https://api.github.com/repos/hybridgroup/cylon-gpio/issues/33","id":136020983,"user":{"login":"edgarsilva","id":518231,"avatar_url":"https://avatars.githubusercontent.com/u/518231?v=3","gravatar_id":"","url":"https://api.github.com/users/edgarsilva","html_url":"https://github.com/edgarsilva","followers_url":"https://api.github.com/users/edgarsilva/followers","following_url":"https://api.github.com/users/edgarsilva/following{/other_user}","gists_url":"https://api.github.com/users/edgarsilva/gists{/gist_id}","starred_url":"https://api.github.com/users/edgarsilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgarsilva/subscriptions","organizations_url":"https://api.github.com/users/edgarsilva/orgs","repos_url":"https://api.github.com/users/edgarsilva/repos","events_url":"https://api.github.com/users/edgarsilva/events{/privacy}","received_events_url":"https://api.github.com/users/edgarsilva/received_events","type":"User","site_admin":false},"created_at":"2015-08-29T18:06:01Z","updated_at":"2015-08-29T18:06:01Z","body":"@ericterpstra that's great! do you wanna submit a PR? I can merge afterwards, then the only issue is that the lowest the value the faster it goes backwards, we have it setup for 89 which as you mentioned is not enough for it to spin backwards.\r\n\r\nLet me know, if you are otherwise busy I'll fix the code later today."}}