Arduino 入门教程 (十四) millis()函数

此函数用于返回的Arduino板开始运行当前程序时的毫秒数这个数字在大约50天后溢出,即回到零。 

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); 
}

 

你可能感兴趣的:(Arduino,Arduino)