![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This drive is working well with "LPD3806-600BM-G5-24G", and have Simple program, external pull-up resistance is required
注意:需要外置上拉电阻。
main.cpp
- Committer:
- Yifan_Du
- Date:
- 2019-02-08
- Revision:
- 2:7d34758c3cc4
- Parent:
- 1:4d205546ec69
File content as of revision 2:7d34758c3cc4:
// Attention: External pull-up resistance is required /* Red Line -> 5V Black Line -> GND Green Line -> your STM32 pin White Line -> your STM32 pin */ #include "mbed.h" #include "Rotary_Encoder.h" // (White Line, Green Line) Rotary_Encoder Encoder(PA_0, PA_1); int main(void) { while(1) { printf("Direction: %s\r\n", Encoder.Calculate_Direction()); printf("\r\n"); wait(0.2); } }