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.
Dependencies: mbed QEI HIDScope BiQuad4th_order biquadFilter MODSERIAL FastPWM
main.cpp
- Committer:
- sanou8
- Date:
- 2019-10-14
- Revision:
- 2:3feeeb434275
- Parent:
- 1:b862262a9d14
- Child:
- 3:695daa59763d
File content as of revision 2:3feeeb434275:
#include "mbed.h"
//#include "HIDScope.h"
#include "QEI.h"
#include "MODSERIAL.h"
//#include "BiQuad.h"
//#include "FastPWM.h"
MODSERIAL pc(USBTX, USBRX);
InterruptIn button(SW3);
Ticker motor;
volatile int counts;
void readencoder()
{
QEI Encoder(D12,D13,NC,32);
counts = Encoder.getPulses();
}
void print()
{
pc.printf("%i",counts);
}
int main()
{
button.mode(PullUp);
pc.baud(115200);
button.rise(print);
motor.attach(readencoder, 0.002);
while (true)
{
}
}