Kazushi Yamanobe / Mbed 2 deprecated R-ciliatable_4

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EC12E2420801.h Source File

EC12E2420801.h

00001 #ifndef ENCODER_H
00002 #define ENCODER_H
00003 
00004 #include "mbed.h"
00005 
00006 /****定数****/
00007 #define PI 3.1415f
00008 #define RADIAN 360
00009 #define MINUTE 60
00010 #define CALCULATE_PERIOD 0.01f
00011 
00012 enum DATA_CATEGORY{
00013     COUNT,
00014 };
00015 
00016 
00017 class Encoder {
00018     public:
00019         Encoder(PinName Apulse,PinName Bpulse);
00020         float getData(short ch);
00021         bool reset(int preset = 0);
00022         
00023     private:
00024         InterruptIn Apulse;
00025         InterruptIn Bpulse;
00026     
00027         void Apulse_Down();
00028         
00029         int preset;
00030         float count;
00031 };
00032 
00033 #endif