2 Phase different signals rotational encoder library 2相位相差型ロータリーエンコーダ用ライブラリ。 絶対値パルス関数。相対値(前回読み出しからの差)パルス出力関数。秋月電子のEC12PLRGBSDVBF-D-25K-24-24C-61で動作確認した。http://akizukidenshi.com/catalog/g/gP-05773/
Dependents: RotationalEncoder_Hello
example program
Import programRotationalEncoder_Hello
RotationalEncoder library's example program
Revision 2:0102de0ec7a7, committed 2016-10-23
- Comitter:
- suupen
- Date:
- Sun Oct 23 03:44:28 2016 +0000
- Parent:
- 1:57c43aac7007
- Commit message:
- include comment to example program code
Changed in this revision
RotationalEncoder.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 57c43aac7007 -r 0102de0ec7a7 RotationalEncoder.h --- a/RotationalEncoder.h Sun Oct 23 02:18:28 2016 +0000 +++ b/RotationalEncoder.h Sun Oct 23 03:44:28 2016 +0000 @@ -45,7 +45,23 @@ * *2:interrupt up side is dicition process * * <example program> + * @code + * #include "mbed.h" + * #include "RotationalEncoder.h" * + * RotationalEncoder encoder(p21, p23); + * + * BusOut led(LED1, LED2, LED3, LED4); + * + * int main() { + * while(1) { + * + * led = encoder.getAbsolutePulses(); + * printf("abs = %4i rel = %4i\r\n",encoder.getAbsolutePulses(), encoder.getRelativePulses()); + * + * } + * } + * @endcode */