Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed-dev-bin nRF51822-bluetooth-mdw
Fork of microbit-dal-bluetooth-mdw by
MicroBitEvent Class Reference
Class definition for a MicroBitEvent. More...
#include <MicroBitEvent.h>
Public Member Functions | |
| MicroBitEvent (uint16_t source, uint16_t value, MicroBitEventLaunchMode mode=MICROBIT_EVENT_DEFAULT_LAUNCH_MODE) | |
| Constructor. | |
| MicroBitEvent () | |
| Default constructor - initialises all values, and sets timestamp to the current time. | |
| void | fire () |
| Fires this MicroBitEvent onto the Default EventModel, or a custom one! | |
Detailed Description
Class definition for a MicroBitEvent.
It represents a common event that is generated by the various components on the micro:bit.
Definition at line 49 of file MicroBitEvent.h.
Constructor & Destructor Documentation
| MicroBitEvent | ( | uint16_t | source, |
| uint16_t | value, | ||
| MicroBitEventLaunchMode | mode = MICROBIT_EVENT_DEFAULT_LAUNCH_MODE |
||
| ) |
Constructor.
- Parameters:
-
src The id of the MicroBit Component that generated the event e.g. MICROBIT_ID_BUTTON_A. value A component specific code indicating the cause of the event. mode Optional definition of how the event should be processed after construction (if at all): CREATE_ONLY: MicroBitEvent is initialised, and no further processing takes place. CREATE_AND_FIRE: MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).
// Create and launch an event using the default configuration MicrobitEvent evt(id,MICROBIT_BUTTON_EVT_CLICK); // Create an event only, do not fire onto an EventModel. MicrobitEvent evt(id,MICROBIT_BUTTON_EVT_CLICK,CREATE_AND_FIRE);
Definition at line 57 of file MicroBitEvent.cpp.
| MicroBitEvent | ( | ) |
Default constructor - initialises all values, and sets timestamp to the current time.
Definition at line 70 of file MicroBitEvent.cpp.
Member Function Documentation
| void fire | ( | ) |
Fires this MicroBitEvent onto the Default EventModel, or a custom one!
Definition at line 80 of file MicroBitEvent.cpp.
Generated on Tue Jul 12 2022 12:45:47 by
1.7.2
