MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / onPush

Function onPush

examples/drivers/m5dial-rotary_encoder/main.js:42–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40const buzzer = new device.peripheral.tone.Default();
41const button = new device.peripheral.button.A({
42 onPush() {
43 const pressed = this.pressed;
44 trace(`pressed: ${pressed}\n`);
45 if (pressed) {
46 rotaryEncoder.write(0);
47 current = 0;
48 buzzer.tone(2000, 20);
49 drawCount(current.toString());
50 }
51 },
52});
53
54const rotaryEncoder = new device.peripheral.RotaryEncoder({

Callers

nothing calls this directly

Calls 3

drawCountFunction · 0.85
writeMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected