Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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
Generated on Wed Jul 27 2022 12:59:15 by
