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:
- Yifan_Du
- Date:
- 2019-02-08
- Revision:
- 1:4d205546ec69
- Parent:
- 0:b2ffb830539c
- Child:
- 2:7d34758c3cc4
File content as of revision 1:4d205546ec69:
// Attention: External pull-up resistance is required
#include "mbed.h"
#include "Rotary_Encoder.h"
// (White Line, Green Line)
Rotary_Encoder Encoder(PA_0, PA_1);
int main(void)
{
while(1)
{
printf("Direction: %s\r\n", Encoder.Calculate_Direction());
printf("\r\n");
wait(0.2);
}
}