Keyestudio_Button

Keyestudio button module.

wired(obniz, { signal [, vcc, gnd]});

name type required default description
signal number(obniz Board io) yes   Signal pin of state output(s pin of Keyestudio)
vcc number(obniz Board io) no   VCC for button(+ pin of Keyestudio)
gnd number(obniz Board io) no   GND for button(- pin of Keyestudio)
// Javascript Example
var button = obniz.wired("Keyestudio_Button", {signal:0, vcc:1, gnd:2});
button.onchange = function(voltage) {
  console.log(voltage);
}

onchange = function(pressed){}

called when button pressed/released.

// Javascript Example
var button = obniz.wired("Keyestudio_Button", {signal:0, vcc:1, gnd:2});
button.onchange = function(pressed){
  console.log("pressed:" + pressed)
};

[await] isPressedWait()

Check current button with waiting result.

// Javascript Example
var button = obniz.wired("Keyestudio_Button", {signal:0, vcc:1, gnd:2});
var pressed = await button.isPressedWait();
console.log("Pressed = " + pressed);

[await] stateWait()

Wait until push/release button.

// Javascript Example
var button = obniz.wired("Keyestudio_Button", {signal:0, vcc:1, gnd:2});
await button.stateWait(false); 
console.log("button pushed!");
await button.stateWait(true); 
console.log("button released");



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