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
main.cpp
- Committer:
- henriquer
- Date:
- 2020-09-16
- Revision:
- 0:0faa3d26e55e
- Child:
- 1:6192e5b45a58
File content as of revision 0:0faa3d26e55e:
# include "mbed.h"
AnalogIn pot(A0);
InterruptIn Pulso(D7);
DigitalOut scr (D8);
Serial pc(USBTX,USBRX);
int temp = 0;
float analog ;
int angle = 0;
void interrupt ()
{
for (int i = 0; i<temp; i++) {
scr = 1;
wait_us(temp);
scr = 0;
//wait(1);
}
}
int main()
{
Pulso.rise(&interrupt);
while(1) {
analog = pot;
temp = (analog*45); // angulo
pc.printf("\n\r%1.3f ",analog);
wait(0.5);
temp =0;
}
}