DCMotor

Common Brushed DC Motor which moves when connected to +/- and reverse when connected to other side.

wire({forward, back})

connect two wire to an obniz Board and set io number to forward,back.
If you connect to io 0 and 1, then write a program like a below.

photo of DCMotor

// Javascript Example
var motor = obniz.wired("DCMotor",  {forward:0, back:1});
motor.power(50);
motor.forward();

forward()

start moving forward.

// Javascript Example
var motor = obniz.wired("DCMotor", {forward:0, back:1});

motor.forward();

reverse()

start moving to back.

// Javascript Example
var motor = obniz.wired("DCMotor", {forward:0, back:1});

motor.reverse();

stop()

stop a motor.

// Javascript Example
var motor = obniz.wired("DCMotor", {forward:0, back:1});

motor.forward();
setTimeout(function(){
  motor.stop();
}, 1000);

move(boolean)

move a motor regard provided value.

// Javascript Example
var motor = obniz.wired("DCMotor", {forward:0, back:1});

motor.move(true); // = motor.forward();

power(float)

set a motor power.

default is 30.

power must be within 0~100.

// Javascript Example
var motor = obniz.wired("DCMotor", {forward:0, back:1});

motor.power(80);
motor.move(true);


Found at :





You will Get in Few Days

Circuit for Starter “obniz Board” is available on Amazon and other online stores.
You can get it at below

Our products and resellers

Forum

Visit our developer’s forum to discuss and discover technologies.

Forum

Contact

Feel free to contact out support and technical team.

Contact us