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:
- Javierdf
- Date:
- 2019-09-22
- Revision:
- 0:e507ed1402e5
File content as of revision 0:e507ed1402e5:
#include "mbed.h"
Ticker flipper;
Serial pc(USBTX,USBRX);
AnalogIn a1(A0);
DigitalOut hz(D2);
int y;
void tono_on()
{
if(y>100)
{
hz=1;
}
else hz=0;
}
/*void tono_off()
{
if(y>100)
{
hz=0;
}
}*/
int main()
{
flipper.attach(&tono_on,0.001 );
while (true)
{
y=270*a1.read();
//flipper.attach(&tono_on,0.01 );
//flipper.attach(&tono_off,0.001 );
pc.printf("%d\n",y);
}
}