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
timer.cpp
00001 00002 #include "mbed.h" 00003 00004 DigitalIn button1(D4); // 버튼을 D4에 연 00005 00006 00007 00008 Timer timer; 00009 00010 int main() 00011 { 00012 button1.mode(PullUp); // Set PullUp 00013 00014 timer.start(); // Start the timer 00015 printf("Timer Start!\n"); 00016 00017 while(1) 00018 { 00019 if(button1 == 0) // if push the button1 00020 { 00021 timer.stop(); // Stop the timer 00022 printf("%f seconds\n", timer.read()); 00023 break; 00024 } 00025 } 00026 } 00027 00028 //[출처] ARM mbed 기초 강좌 : 12. 타이머 (스위치 및 가상 시리얼 통신 이용) (오픈소스 소프트웨어 & 하드웨어: 로봇 기술 공유 카페 (오로카)) |작성자 표윤석 00029
Generated on Fri Aug 12 2022 01:41:08 by
1.7.2
