micros()函数返回从时间开始的微秒数,Arduino板开始运行当前程序。 该数字溢出,即在大约70分钟后回到零。 在16 MHz Arduino板(例如Duemilanove和Nano)上,此函数的分辨率为4微秒(即返回的值总是4的倍数)。 在8 MHz Arduino电路板(例如LilyPad)上,此功能的分辨率为8微秒。

micros()函数语法

micros () ;

此函数返回自程序启动以来的微秒数(unsigned long)

例子

unsigned long time; void setup() { 
   Serial.begin(9600); 
} 

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

新闻动态 联系方式 广告合作 招聘英才 安科实验室 帮助与反馈 About Us

Copyright © 2013 - 2019 Ancii.com All Rights Reserved京ICP备18063983号-5 京公网安备11010802014868号