ev3dev / ev3dev-lang

(deprecated) language bindings for ev3dev sensors, motors, LEDs, etc.
GNU General Public License v2.0
56 stars 39 forks source link

Javascript motor and sensor example #166

Closed liam-b closed 8 years ago

liam-b commented 8 years ago

I really need a quick demo of how to use node.js to run motors and get inputs from sensors. I've got npm and node installed and I've required the language like so:

var ev3dev = require('ev3dev-lang');

var motor = new ev3dev.LargeMotor('outA'); // trying to setup a new motor

but I can't find any code examples anywhere online. Can someone show me how to get anything working? Thanks

WasabiFan commented 8 years ago

Check out the examples directory in the ev3dev-lang-js repo; there you can find examples on how to use motors, sensors and various other things. You should mainly check out these ones for motors (although there is one that uses both motors and sensors):

WasabiFan commented 8 years ago

Also, make sure to check out the online documentation. The motor methods are here.

liam-b commented 8 years ago

Hey thanks, that really helps :D