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.
Diff: main.cpp
- Revision:
- 0:80c3517c7928
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Jun 21 06:46:14 2014 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" +#include "rtos.h" + +Timer t; +DigitalOut myled(LED1); +Serial pc(USBTX,USBRX); +Thread *thp; + +void stuff(void const * args) +{ + // int a; + while(1) + { + pc.printf("\nhey \n"); + t.start(); + pc.getc(); + t.stop(); + t.reset(); + pc.printf("\nGottil\n"); + } +} +int main() +{ + thp = new Thread(stuff); + while(1) + { + if(t.read()>10.0) + { + t.stop(); + t.reset(); + thp->terminate(); + delete thp; + thp=new Thread(stuff); + + pc.printf("restarted"); + } + + } + +}