データの保存、更新、取得ができるWebサービス「milkcocoa」に接続し、データのプッシュ、送信、取得ができるライブラリを使ったサンプルです。ESP8266版 https://mlkcca.com/

Dependencies:   Milkcocoa mbed

Dependents:   M2m

SoftSerialSendOnly/SoftSerial_Ticker.h

Committer:
jksoft
Date:
2016-02-29
Revision:
4:d40cc9301d1e
Parent:
0:82d5445a9461

File content as of revision 4:d40cc9301d1e:

//A modified version of the regular ticker/timeout libraries to allow us to do timeout without losing accuracy

#ifndef FLEXTICKER_H
#define FLEXTICKER_H

#include "mbed.h"

class FlexTicker: public TimerEvent {
    public:
    template<typename T>
    void attach(T* tptr, void (T::*mptr)(void)) {
        _function.attach(tptr, mptr);
    }
 
    /** Detach the function
     */
    void detach() {
        remove();
    }
    
    void setNext(int delay) {
        insert(event.timestamp + delay);
    }
    
    void prime(void) {
        event.timestamp = us_ticker_read();
    }
 
protected:
    virtual void handler() {
        _function.call();
    }
 
    unsigned int _delay;
    FunctionPointer _function;
};

#endif