“DelayMicroseconds()”的版本间的差异
(创建页面,内容为“<pre style="color:green"> void delayMicroseconds (unsigned int us) </pre> 延时(微秒) <br> 延时, 单位为微妙(1毫秒有1000微妙). 如果延时的时...”) |
(没有差异)
|
2016年5月23日 (一) 09:08的最新版本
void delayMicroseconds (unsigned int us)
延时(微秒)
延时, 单位为微妙(1毫秒有1000微妙). 如果延时的时间有几千微妙, 那么建议使用 delay 函数. 目前参数最大支持16383微妙(不过以后的版本中可能会变化).
- 例子
以下代码向第8号引脚发送脉冲, 每次脉冲持续50微妙的时间.
int outPin = 8; // digital pin 8 void setup() { pinMode(outPin, OUTPUT); // sets the digital pin as output } void loop() { digitalWrite(outPin, HIGH); // sets the pin on delayMicroseconds(50); // pauses for 50 microseconds digitalWrite(outPin, LOW); // sets the pin off delayMicroseconds(50); // pauses for 50 microseconds }