![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
TOF based Presence Detector
Dependencies: BLE_API X_NUCLEO_6180XA1 X_NUCLEO_IDB0XA1 mbed
Fork of BLE_HeartRate_IDB0XA1 by
bricks/blink.h@29:eceecbe28088, 2018-08-20 (annotated)
- Committer:
- hux
- Date:
- Mon Aug 20 16:43:10 2018 +0000
- Revision:
- 29:eceecbe28088
- Parent:
- 28:a23b16555909
made in Shanghai
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hux | 28:a23b16555909 | 1 | // blink.h - blinking sequences for LED1 |
hux | 28:a23b16555909 | 2 | #ifndef _BLINK_H_ |
hux | 28:a23b16555909 | 3 | #define _BLINK_H_ |
hux | 28:a23b16555909 | 4 | |
hux | 28:a23b16555909 | 5 | #include <mbed.h> |
hux | 28:a23b16555909 | 6 | #include "bricks/o.h" |
hux | 28:a23b16555909 | 7 | |
hux | 28:a23b16555909 | 8 | # define BLINK_SEQUENCE_IDLE "x " |
hux | 28:a23b16555909 | 9 | # define BLINK_SEQUENCE_ADVERTISE "x xxx " |
hux | 28:a23b16555909 | 10 | # define BLINK_SEQUENCE_CONNECTED " xxx " |
hux | 28:a23b16555909 | 11 | # define BLINK_SEQUENCE_ACTION "x x x x x " |
hux | 28:a23b16555909 | 12 | # define BLINK_SEQUENCE_ERROR "x x x x xxx " |
hux | 28:a23b16555909 | 13 | # define BLINK_SEQUENCE_TRANSITION "x x x " |
hux | 28:a23b16555909 | 14 | |
hux | 28:a23b16555909 | 15 | void morse(O&o,const char *pattern, double periode = 0.2); |
hux | 28:a23b16555909 | 16 | void blink(O&o,const char *pattern, const char* next, double interval = 0.2); |
hux | 28:a23b16555909 | 17 | void blink(O&o,const char *pattern, double periode = 0.2); |
hux | 28:a23b16555909 | 18 | |
hux | 28:a23b16555909 | 19 | inline void blinkIdle(O&o, const char *action = BLINK_SEQUENCE_IDLE) |
hux | 28:a23b16555909 | 20 | { |
hux | 28:a23b16555909 | 21 | blink(o,action,BLINK_SEQUENCE_IDLE); |
hux | 28:a23b16555909 | 22 | } |
hux | 28:a23b16555909 | 23 | |
hux | 28:a23b16555909 | 24 | inline void blinkAdvertise(O&o,const char *action = BLINK_SEQUENCE_ADVERTISE) |
hux | 28:a23b16555909 | 25 | { |
hux | 28:a23b16555909 | 26 | blink(o,action,BLINK_SEQUENCE_ADVERTISE); |
hux | 28:a23b16555909 | 27 | } |
hux | 28:a23b16555909 | 28 | |
hux | 28:a23b16555909 | 29 | inline void blinkConnected(O&o, const char *action = BLINK_SEQUENCE_ACTION) |
hux | 28:a23b16555909 | 30 | { |
hux | 28:a23b16555909 | 31 | blink(o,action, BLINK_SEQUENCE_CONNECTED); |
hux | 28:a23b16555909 | 32 | } |
hux | 28:a23b16555909 | 33 | |
hux | 28:a23b16555909 | 34 | inline void blinkAction(O&o) // 'action' blink sequence |
hux | 28:a23b16555909 | 35 | { |
hux | 28:a23b16555909 | 36 | blink(o,BLINK_SEQUENCE_ACTION, BLINK_SEQUENCE_IDLE); |
hux | 28:a23b16555909 | 37 | } |
hux | 28:a23b16555909 | 38 | |
hux | 28:a23b16555909 | 39 | inline void blinkError(O&o, const char *action = BLINK_SEQUENCE_ERROR) |
hux | 28:a23b16555909 | 40 | { |
hux | 28:a23b16555909 | 41 | blink(o,action,BLINK_SEQUENCE_ERROR); |
hux | 28:a23b16555909 | 42 | } |
hux | 28:a23b16555909 | 43 | |
hux | 28:a23b16555909 | 44 | inline void blink(O&o) // stop blinking |
hux | 28:a23b16555909 | 45 | { |
hux | 28:a23b16555909 | 46 | blink(o,""); // empty blinking pattern |
hux | 28:a23b16555909 | 47 | } |
hux | 28:a23b16555909 | 48 | |
hux | 28:a23b16555909 | 49 | #endif // _BLINK_H_ |