Hugo Pristauz / Mbed 2 deprecated S14_TOF_Detector

Dependencies:   BLE_API X_NUCLEO_6180XA1 X_NUCLEO_IDB0XA1 mbed

Fork of BLE_HeartRate_IDB0XA1 by ST

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers blinker.h Source File

blinker.h

00001 // blinker.h - blinking sequences for LED1
00002 #ifndef _BLINKER_H_
00003 #define _BLINKER_H_
00004 
00005 #include <mbed.h>
00006 
00007 #  define BLINKER_SEQUENCE_IDLE         "x       "
00008 #  define BLINKER_SEQUENCE_ADVERTISE    "x xxx       "
00009 #  define BLINKER_SEQUENCE_CONNECTED    "  xxx       "
00010 #  define BLINKER_SEQUENCE_ACTION       "x x x x x       "
00011 #  define BLINKER_SEQUENCE_ERROR        "x x x x xxx "
00012 #  define BLINKER_SEQUENCE_TRANSITION   "x x x   "
00013 
00014    class Blinker
00015    {
00016       public:   // construction
00017          Blinker() {}                  // nothing to do
00018          
00019       public:
00020          void morse(const char *pattern, double periode = 0.2);
00021          void blink(const char *pattern, const char* next, double interval = 0.2);
00022          void blink(const char *pattern, double periode = 0.2);
00023 
00024          void idle(const char *action = BLINKER_SEQUENCE_IDLE)
00025          {
00026             blink(action,BLINKER_SEQUENCE_IDLE);
00027          }
00028 
00029          void advertise(const char *action = BLINKER_SEQUENCE_ADVERTISE)
00030          {
00031             blink(action,BLINKER_SEQUENCE_ADVERTISE);
00032          }
00033    
00034          void connected(const char *action = BLINKER_SEQUENCE_ACTION) 
00035          {
00036             blink(action, BLINKER_SEQUENCE_CONNECTED);  
00037          }
00038 
00039          void action()                 // 'action' blink sequence
00040          {
00041             blink(BLINKER_SEQUENCE_ACTION, BLINKER_SEQUENCE_IDLE);
00042          }
00043 
00044          void blinkError(const char *action = BLINKER_SEQUENCE_ERROR)
00045          {
00046             blink(action,BLINKER_SEQUENCE_ERROR);
00047          }
00048 
00049          void blink()                  // stop blinking
00050          {
00051             blink("");                 // empty blinking pattern
00052          }
00053    };
00054    
00055 #endif // _BLINKER_H_