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: serial_connected_mcu_nucleo rotary_encoder_mbed serial_connected_mcu_nucleo omuni_speed_pid ... more
Fork of rotary_encoder by
You are viewing an older revision! See the latest version
rotary_encoder
このライブラリはSTM32のハードウェアの機能を使って、A相およびAB相でインクリメンタル形のロータリーエンコーダから回転情報を得ることを可能にします。
注意!
このライブラリはNUCLEO-F401REでしか動作確認をしていません。
<<code title=例 AB相 100P/R>>
- include "mbed.h"
- include "rotary_encoder_ab_phase.hpp"
int main() { rotary_encoder_ab_phase e(/* timer_type = */TIM3, /* pulse_per_revol = */100); e.start();
while (true) { printf("%d, %f\n", e.get_counts(), e.get_revol_num()); }
return 0; } <</code>>
<<code title=例 A相 100P/R>>
- include "mbed.h"
- include "rotary_encoder_a_phase.hpp"
int main() { rotary_encoder_a_phase e(/* timer_type = */TIM3, /* pulse_per_revol = */100); e.start();
while (true) { printf("%d, %f\n", e.get_counts(), e.get_revol_num()); }
return 0; } <</code>>
