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: QEI MPU6050 TB6612FNG
main.cpp
- Committer:
- Satoshisatoshi
- Date:
- 2021-05-07
- Revision:
- 0:d6107da1cba0
File content as of revision 0:d6107da1cba0:
#include "mbed.h"
#include "MPU6050.h"
#include "QEI.h"
#include "TB6612FNG.h"
MPU6050 mpu1(p9,p10,0x68);
MPU6050 mpu2(p9,p10,0x69);
Serial pc(USBTX,USBRX);
QEI wheel(p22, p21, NC, 12, QEI::X4_ENCODING);
int main(){
while(1){
pc.printf("%.2f\n", ((float)wheel.getPulses()));
pc.printf("%.2f\n", ((float)wheel.getRevolutions()));
wait(0.1);
}
}