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.
main.cpp
- Committer:
- maxnagazumi
- Date:
- 2019-10-18
- Revision:
- 0:ef259ff25554
- Child:
- 1:9732c03b0de4
File content as of revision 0:ef259ff25554:
#include "mbed.h"
#include "EC.h" //Encoderライブラリをインクルード
#include "SpeedController.h" //SpeedControlライブラリをインクルード
#define RESOLUTION 500
PwmOut f(PA_9);
PwmOut b(PA_10);
DigitalIn s(PB_7,PullUp);
Ec4multi EC(PA_6,PA_7,RESOLUTION);
int main()
{
printf("%d\n",s.read());
f.period_us(50);
b.period_us(50);
while(1) {
printf("omega=%f\r\n",EC.getOmega());
wait(0.1);
f = 0.2;
if(s.read() ==0)break;
}
f=0;
b=0;
return 0;
}