test

Dependencies:   mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "rtos.h"
00003 #include <iostream>
00004 
00005 using namespace std;
00006 
00007 DigitalOut led1(LED1);
00008 
00009 void print_thread(void const *argument)
00010 {
00011     while (true) {
00012         Thread::wait(1000);
00013         cout << "print_thread!\r" << endl;
00014     }
00015 }
00016 
00017 int main()
00018 {
00019     cout << "BASIC EXAMPLE\r\n";
00020     Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
00021     while (true) {
00022         led1 = !led1;
00023         Thread::wait(500);
00024         cout << "LED Thread\r" << endl;
00025     }
00026 }