This drive is working well with "LPD3806-600BM-G5-24G", and have Simple program

Dependencies:   mbed

Committer:
Yifan_Du
Date:
Sat Feb 02 21:19:30 2019 +0000
Revision:
0:b2ffb830539c
Child:
1:4d205546ec69
Driver and sample program for rotary encoder. it is working well with"LDP3806-600BM-G5-24G".

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Yifan_Du 0:b2ffb830539c 1 #include "mbed.h"
Yifan_Du 0:b2ffb830539c 2 #include "Rotary_Encoder.h"
Yifan_Du 0:b2ffb830539c 3
Yifan_Du 0:b2ffb830539c 4 Rotary_Encoder Encoder(PA_0, PA_1);
Yifan_Du 0:b2ffb830539c 5
Yifan_Du 0:b2ffb830539c 6 int main(void)
Yifan_Du 0:b2ffb830539c 7 {
Yifan_Du 0:b2ffb830539c 8 while(1)
Yifan_Du 0:b2ffb830539c 9 {
Yifan_Du 0:b2ffb830539c 10 printf("Direction: %s\r\n", Encoder.Calculate_Direction());
Yifan_Du 0:b2ffb830539c 11 printf("\r\n");
Yifan_Du 0:b2ffb830539c 12
Yifan_Du 0:b2ffb830539c 13 wait(0.2);
Yifan_Du 0:b2ffb830539c 14 }
Yifan_Du 0:b2ffb830539c 15 }