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:
- Wizo
- Date:
- 2018-11-15
- Revision:
- 0:65dee900759a
File content as of revision 0:65dee900759a:
#include "mbed.h"
Timer timer1; // define timer object
DigitalOut output1(p5); // digital output
void task1(void); // task function prototype
//*** main code
int main()
{
timer1.start(); // start timer counting
while(1) {
if (timer1.read_ms()>=200) { // read time in ms
task1(); // call task function
timer1.reset(); // reset timer
}
}
}
void task1(void) // task function
{
output1=!output1; // toggle output
}