()
| 40 | const buzzer = new device.peripheral.tone.Default(); |
| 41 | const 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 | |
| 54 | const rotaryEncoder = new device.peripheral.RotaryEncoder({ |