Thomas Hartmann / HoverboardTest

Dependencies:   WiiNunchuck mbed-dev

HallDecoder.h

Committer:
Thomas_H
Date:
2016-10-23
Revision:
1:5acd27cb1857
Parent:
0:fe156910301e

File content as of revision 1:5acd27cb1857:

#ifndef HALLDECODER_H
#define HALLDECODER_H

#include "mbed.h"


class HallDecoder {

public:
    HallDecoder(PinName hall1, PinName hall2, PinName hall3);
    int32_t getticks();
    void resetticks();
    
    void hall1_handler();
    void hall2_handler();
    void hall3_handler();

private:
    InterruptIn         _int1;
    InterruptIn         _int2;
    InterruptIn         _int3; 
    volatile int32_t    _ticks;
    volatile uint8_t    _lastint;
};


#endif