pxt-calliope/docs/reference/control/on-event.md
2016-07-21 13:29:59 -07:00

12 lines
378 B
Markdown

# On Event
Raise an event in the event bus.
```sig
control.onEvent(control.eventSourceId(EventBusSource.MICROBIT_ID_BUTTON_A), control.eventValueId(EventBusValue.MICROBIT_EVT_ANY), () => { });
```
**This is an advanced API.** For more information, see the
[micro:bit runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/).