zhouhang shao
/
test
test
Diff: encoder.h
- Revision:
- 2:b78dfa2afe92
- Child:
- 3:34a763e93423
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/encoder.h Sat May 06 23:10:06 2017 +0000 @@ -0,0 +1,43 @@ +//#ifndef ENCODER_H +//#define ENCODER_H +//#include "mbed.h" +// +///* +//* Reset both encoders +//*/ +//void resetEncoders(); +// +///* +//Returns the average number of pulses across both encoders since last reset. Unit is encoder pulses; intended for straight driving only. +//*/ +//int getEncoderDistance(); +// +// +//class Encoder { +//public: +// volatile int pulses; +// +// Encoder(PinName channelA, PinName channelB); +// +// //Reset the encoder +// void reset(void); +// +// //Gets pulses by directly querying the encoder. +// operator int() { +// return pulses; +// } +// +//private: +// InterruptIn channelA_; +// InterruptIn channelB_; +// int prevState_; +// int currState_; +// +// void encode(void); +//}; +// +// +//extern Encoder leftEncoder; +// +// +//#endif \ No newline at end of file