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.
Dependents: RobotControl_Sample2022 sotsuken_mecha
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
Generated on Wed Jul 13 2022 07:27:16 by
1.7.2