Hugo Pristauz / Mbed 2 deprecated S13_TOF_GAP

Dependencies:   BLE_API X_NUCLEO_6180XA1 mbed

Fork of BLE_HeartRate_IDB0XA1 by ST

Committer:
hux
Date:
Mon Aug 20 16:41:36 2018 +0000
Revision:
28:86a594313434
GAP based TOF Sensor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hux 28:86a594313434 1 // blinker.h - blinking sequences for LED1
hux 28:86a594313434 2 #ifndef _BLINKER_H_
hux 28:86a594313434 3 #define _BLINKER_H_
hux 28:86a594313434 4
hux 28:86a594313434 5 #include <mbed.h>
hux 28:86a594313434 6
hux 28:86a594313434 7 # define BLINKER_SEQUENCE_IDLE "x "
hux 28:86a594313434 8 # define BLINKER_SEQUENCE_ADVERTISE "x xxx "
hux 28:86a594313434 9 # define BLINKER_SEQUENCE_CONNECTED " xxx "
hux 28:86a594313434 10 # define BLINKER_SEQUENCE_ACTION "x x x x x "
hux 28:86a594313434 11 # define BLINKER_SEQUENCE_ERROR "x x x x xxx "
hux 28:86a594313434 12 # define BLINKER_SEQUENCE_TRANSITION "x x x "
hux 28:86a594313434 13
hux 28:86a594313434 14 class Blinker
hux 28:86a594313434 15 {
hux 28:86a594313434 16 public: // construction
hux 28:86a594313434 17 Blinker() {} // nothing to do
hux 28:86a594313434 18
hux 28:86a594313434 19 public:
hux 28:86a594313434 20 void morse(const char *pattern, double periode = 0.2);
hux 28:86a594313434 21 void blink(const char *pattern, const char* next, double interval = 0.2);
hux 28:86a594313434 22 void blink(const char *pattern, double periode = 0.2);
hux 28:86a594313434 23
hux 28:86a594313434 24 void idle(const char *action = BLINKER_SEQUENCE_IDLE)
hux 28:86a594313434 25 {
hux 28:86a594313434 26 blink(action,BLINKER_SEQUENCE_IDLE);
hux 28:86a594313434 27 }
hux 28:86a594313434 28
hux 28:86a594313434 29 void advertise(const char *action = BLINKER_SEQUENCE_ADVERTISE)
hux 28:86a594313434 30 {
hux 28:86a594313434 31 blink(action,BLINKER_SEQUENCE_ADVERTISE);
hux 28:86a594313434 32 }
hux 28:86a594313434 33
hux 28:86a594313434 34 void connected(const char *action = BLINKER_SEQUENCE_ACTION)
hux 28:86a594313434 35 {
hux 28:86a594313434 36 blink(action, BLINKER_SEQUENCE_CONNECTED);
hux 28:86a594313434 37 }
hux 28:86a594313434 38
hux 28:86a594313434 39 void action() // 'action' blink sequence
hux 28:86a594313434 40 {
hux 28:86a594313434 41 blink(BLINKER_SEQUENCE_ACTION, BLINKER_SEQUENCE_IDLE);
hux 28:86a594313434 42 }
hux 28:86a594313434 43
hux 28:86a594313434 44 void blinkError(const char *action = BLINKER_SEQUENCE_ERROR)
hux 28:86a594313434 45 {
hux 28:86a594313434 46 blink(action,BLINKER_SEQUENCE_ERROR);
hux 28:86a594313434 47 }
hux 28:86a594313434 48
hux 28:86a594313434 49 void blink() // stop blinking
hux 28:86a594313434 50 {
hux 28:86a594313434 51 blink(""); // empty blinking pattern
hux 28:86a594313434 52 }
hux 28:86a594313434 53 };
hux 28:86a594313434 54
hux 28:86a594313434 55 #endif // _BLINKER_H_