obniz Parts Library

Solenoid

GitHub
Solenoid
Usable Devices :
obniz_board
Found at :
秋月電子通商

Solenoid

Solenoid is a coil with pistone.

Solenoid consume much energy.
You can connect only Tiny Solenoid directly to an obniz Board.
It's resistance should be more than 5 Ohm.

obniz.wired("Solenoid", {signal, [, gnd]})

Connect two wires to an obniz Board.
Most solenoids has no polarity.

// Javascript Example
var solenoid = obniz.wired('Solenoid', {gnd:0, signal:1});
solenoid.click();

on()

Turning on a solenoid.
Be careful! Your solenoid will start be heated.

// Javascript Example
var solenoid = obniz.wired('Solenoid', {gnd:0, signal:1});
solenoid.on();

off()

Turn off a solenoid

// Javascript Example
var solenoid = obniz.wired('Solenoid', {gnd:0, signal:1});
solenoid.on();
await obniz.wait(1000);
solenoid.off();

click(msec);

It works on->wait->off.
msec is optional. default is 100msec.

// Javascript Example
var solenoid = obniz.wired('Solenoid', {gnd:0, signal:1});
solenoid.click();

doubleClick(msec);

It click twice.

// Javascript Example
var solenoid = obniz.wired('Solenoid', {gnd:0, signal:1});
solenoid.doubleClick();

Supported from: obniz.js 3.5.0