koki konishi / IncEncoder

Dependents:   RobotControl_Sample2022 sotsuken_mecha

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IncEncoder.h Source File

IncEncoder.h

00001 #ifndef MBED_INCENCODER_H
00002 #define MBED_INCENCODER_H
00003 
00004 #include "mbed.h"
00005 
00006 class IncEncoder{
00007 public: 
00008     typedef enum Encoding {
00009         x2_Resolution,
00010         x4_Resolution
00011     } Encoding;
00012     
00013     IncEncoder(PinName ENC_A,PinName ENC_B,Encoding encoding);
00014     
00015     int IncEncoder::GetIncPulses();
00016     
00017     void IncEncoder::reset();
00018     
00019     void IncEncoder::A_RISE();
00020     
00021     void IncEncoder::A_FALL();
00022     
00023     void IncEncoder::B_RISE();
00024     
00025     void IncEncoder::B_FALL();
00026 
00027 private:
00028     int pulses;
00029     
00030     InterruptIn ENC_A_;
00031     InterruptIn ENC_B_;
00032 };
00033 
00034 #endif