Arduino millis()函數


此函數用於返回的Arduino板開始運行當前程序時的毫秒數。這個數字在大約50天后溢出,即回到零。
善於使用millis能使Arduino實行多線程

unsigned long time; 
void setup() { 
   Serial.begin(9600); 
} 
 
void loop() { 
   Serial.print("Time:"); time = millis();
   //prints time since program started
   Serial.println(time); 
   // wait a second so as not to send massive amounts of data
   delay(1000); 
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM