fork microbit-dal
Dependencies: BLE_API mbed-dev-bin nRF51822
Fork of microbit-dal 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 18:28:22 by 1.7.2