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.
EC12E2420801.cpp
00001 #include "EC12E2420801.h" 00002 00003 Encoder::Encoder(PinName Apulse,PinName Bpulse) : Apulse(Apulse),Bpulse(Bpulse) { 00004 Encoder::Apulse.fall(this,&Encoder::Apulse_Down); 00005 } 00006 00007 void Encoder::Apulse_Down() { 00008 if(Bpulse) { 00009 count--; 00010 } else { 00011 count++; 00012 } 00013 } 00014 00015 bool Encoder::reset(int preset) { 00016 count = 0; 00017 return true; 00018 } 00019 00020 /****値返す用の関数****/ 00021 float Encoder::getData(short ch) { 00022 switch(ch) { 00023 case COUNT: 00024 return count; //カウント 00025 default: 00026 return 0; 00027 } 00028 }
Generated on Wed Jul 27 2022 12:59:15 by
