Arduino 的 do-while 循环
do-while 循环在 Arduino 中的语法 与在 C 中的语法类似。如下所示 −
do{
//Code
} while (condition);注意末尾的分号。
示例
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println();
int i = 5;
do{
Serial.println(i);
i--;
} while(i > 0);
}
void loop() {
// put your main code here, to run repeatedly:
}输出
串口监视器的输出如下所示 −

广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP