mirror of https://github.com/ARMmbed/mbed-os.git
29 lines
423 B
C++
29 lines
423 B
C++
#include "mbed.h"
|
|
#include "rtos.h"
|
|
|
|
void print_char(char c = '*')
|
|
{
|
|
printf("%c", c);
|
|
fflush(stdout);
|
|
}
|
|
|
|
DigitalOut led1(LED1);
|
|
DigitalOut led2(LED2);
|
|
|
|
void led2_thread(void const *argument) {
|
|
while (true) {
|
|
led2 = !led2;
|
|
Thread::wait(1000);
|
|
print_char();
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
Thread thread(led2_thread);
|
|
|
|
while (true) {
|
|
led1 = !led1;
|
|
Thread::wait(500);
|
|
}
|
|
}
|