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
Fork of Ticker_3 by
Diff: main.cpp
- Revision:
- 3:9be917b0d07a
- Parent:
- 2:e94dce9a7464
- Child:
- 4:af3ab097055c
diff -r e94dce9a7464 -r 9be917b0d07a main.cpp
--- a/main.cpp Sun Oct 15 11:33:09 2017 +0000
+++ b/main.cpp Sun Oct 15 11:48:11 2017 +0000
@@ -1,14 +1,14 @@
/* Ticker : 함수를 쓰는 시간에 시작하여 원하는 시간이 지나면 특정 함수를 호출하고
다시 초기화 하여 원하는 시간이 되면 호출하는 것을 반복한다.*/
-/*결과: red_LED 5초동안 깜빡이다가 5초동안 멈추는것을 반복*/
+/*결과: red_LED 5초동안 깜빡이다가 green_LED 5초동안 깜빡이는 것을 반복*/
#include "mbed.h"
Ticker timer;
-//DigitalOut ledg(LED2);
-DigitalOut ledr(LED1);
+DigitalOut ledg(D3);
+DigitalOut ledr(D2);
int flip=0;
@@ -22,11 +22,12 @@
if(flip==0)
{
ledr =! ledr;
+
}
else {
- ledr=1;
- // ledg = !ledg;
+
+ ledg = !ledg;
}
wait(0.2);
