Made event type more specific for listening to buttons
This commit is contained in:
parent
d1795695c9
commit
67cf907341
2 changed files with 4 additions and 4 deletions
|
@ -43,8 +43,8 @@ int main()
|
|||
// Initialise the micro:bit runtime.
|
||||
uBit.init();
|
||||
|
||||
uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_EVT_ANY, onButtonA);
|
||||
uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_EVT_ANY, onButtonB);
|
||||
uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, onButtonA);
|
||||
uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonB);
|
||||
|
||||
startAdvertising();
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ int main()
|
|||
// Initialise the micro:bit runtime.
|
||||
uBit.init();
|
||||
|
||||
uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_EVT_ANY, onButtonA);
|
||||
uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_EVT_ANY, onButtonB);
|
||||
uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, onButtonA);
|
||||
uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonB);
|
||||
|
||||
startAdvertising();
|
||||
|
||||
|
|
Loading…
Reference in a new issue