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.
Fork of mbed_AS5047P_driver by
main.cpp
- Committer:
- dhaldane
- Date:
- 2016-03-05
- Revision:
- 0:00c56a9c6dee
- Child:
- 1:d68c51a0a706
File content as of revision 0:00c56a9c6dee:
#include "mbed.h"
#include "enc.h"
Ticker RTI;
DigitalOut myled(LED1);
Serial pc(USBTX, USBRX); // tx, rx
enc crankPos(p5,p6,p7,p8);
void get_state(){
crankPos.update_pos();
}
int main() {
RTI.attach(&get_state, 0.01);
while(1) {
myled = 1;
wait(0.05);
pc.printf("Encoder: %u \r\n", crankPos.cal_state());
myled = 0;
wait(0.05);
}
}
