blinker.h 606 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/*-----------------------------------------------------------------------------
 *  Author: Nelso G. Jost (nelsojost@gmail.com)
 *  License: GPLv2
 *  Purpose: Provide the Blinker class for scheduling a blink process.
 *---------------------------------------------------------------------------*/
#ifndef BLINKER_H
#define BLINKER_H

#include <Ticker.h>

class Blinker
{
public:
    Blinker(int pin);

    Ticker ticker;

    void activate(float interval);
    void deactivate(void);

protected:
    int _pin;
    bool _state = true;
    float _interval;

    static void _update(Blinker *b);
};


#endif