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.
Diff: main.cpp
- Revision:
- 0:1f3576ebcecb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 17 05:42:44 2015 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" +#include "QEI.h" +QEI loli(p21,p22,NC,621); +Serial pc(USBTX,USBRX); + +int main() { + int pulse; + while(1){ + pulse = loli.getPulses()/2; + if (pulse >=360){ + pulse -= 360; + } + if (pulse <= -360){ + pulse += 360; + } + pc.printf("%d\n\r",pulse); + } +}