update input blocks in docs and tests
This commit is contained in:
@ -24,7 +24,7 @@ bluetooth.stopAdvertising();
|
||||
## Example: stop advertising on button pressed
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
bluetooth.stopAdvertising();
|
||||
})
|
||||
```
|
||||
|
@ -27,7 +27,7 @@ bluetooth.onBluetoothDisconnected(() => {
|
||||
basic.showString("D");
|
||||
connected = 0;
|
||||
});
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
if (connected == 1) {
|
||||
bluetooth.uartWriteLine("HELLO");
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ bluetooth.onBluetoothDisconnected(() => {
|
||||
basic.showString("D");
|
||||
connected = 0;
|
||||
});
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
if (connected == 1) {
|
||||
bluetooth.uartWriteString("HELLO");
|
||||
}
|
||||
|
Reference in New Issue
Block a user