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 X_NUCLEO_6180XA1 mbed
Fork of BLE_HeartRate_IDB0XA1 by
bricks/blinker.h
- Committer:
- hux
- Date:
- 2018-08-20
- Revision:
- 28:86a594313434
File content as of revision 28:86a594313434:
// blinker.h - blinking sequences for LED1
#ifndef _BLINKER_H_
#define _BLINKER_H_
#include <mbed.h>
# define BLINKER_SEQUENCE_IDLE "x "
# define BLINKER_SEQUENCE_ADVERTISE "x xxx "
# define BLINKER_SEQUENCE_CONNECTED " xxx "
# define BLINKER_SEQUENCE_ACTION "x x x x x "
# define BLINKER_SEQUENCE_ERROR "x x x x xxx "
# define BLINKER_SEQUENCE_TRANSITION "x x x "
class Blinker
{
public: // construction
Blinker() {} // nothing to do
public:
void morse(const char *pattern, double periode = 0.2);
void blink(const char *pattern, const char* next, double interval = 0.2);
void blink(const char *pattern, double periode = 0.2);
void idle(const char *action = BLINKER_SEQUENCE_IDLE)
{
blink(action,BLINKER_SEQUENCE_IDLE);
}
void advertise(const char *action = BLINKER_SEQUENCE_ADVERTISE)
{
blink(action,BLINKER_SEQUENCE_ADVERTISE);
}
void connected(const char *action = BLINKER_SEQUENCE_ACTION)
{
blink(action, BLINKER_SEQUENCE_CONNECTED);
}
void action() // 'action' blink sequence
{
blink(BLINKER_SEQUENCE_ACTION, BLINKER_SEQUENCE_IDLE);
}
void blinkError(const char *action = BLINKER_SEQUENCE_ERROR)
{
blink(action,BLINKER_SEQUENCE_ERROR);
}
void blink() // stop blinking
{
blink(""); // empty blinking pattern
}
};
#endif // _BLINKER_H_
