收藏 分享(赏)

ARDUINO 编程语法基础.ppt

上传人:精品资料 文档编号:9821981 上传时间:2019-09-09 格式:PPT 页数:25 大小:253.50KB
下载 相关 举报
ARDUINO 编程语法基础.ppt_第1页
第1页 / 共25页
ARDUINO 编程语法基础.ppt_第2页
第2页 / 共25页
ARDUINO 编程语法基础.ppt_第3页
第3页 / 共25页
ARDUINO 编程语法基础.ppt_第4页
第4页 / 共25页
ARDUINO 编程语法基础.ppt_第5页
第5页 / 共25页
点击查看更多>>
资源描述

1、ARDUINO 编程语法基础,结构,setup() loop(),当项目开始运行时会调用setup()函数 常我们在其中初始化一些变量、引脚状态及一些调用的库等 loop函数是一个循环体,其中的程序将会不断的运行,示例 int buttonPin = 3; void setup() Serial.begin(9600); pinMode(buttonPin, INPUT);void loop() if (digitalRead(buttonPin) = HIGH) serialWrite(H); else serialWrite(L); delay(1000); ,控制结构,if if.els

2、e for switch case while do. while break continue return goto,语法,; (分号 ) (大括号 ) / (胆寒注释) /* */ (多汗注释) #define #include,算术运算符,= (assignment operator) + (addition) - (subtraction) * (multiplication) / (division) % (modulo),比较运算符,= (equal to) != (not equal to)(greater than) = (greater than or equal to),

3、布尔运算符,& (and) | (or) ! (not),指针运算符,* dereference operator & reference operator,位运算符,& (bitwise and) | (bitwise or) (bitwise xor) (bitwise not) (bitshift right),复合运算符,+ (increment) - (decrement) += (compound addition) -= (compound subtraction) *= (compound multiplication) /= (compound division) &= (c

4、ompound bitwise and) |= (compound bitwise or),数值,常量 HIGH | LOW INPUT | OUTPUT|INPUT_PULLUP true | false integer constants floating point constants,数值,数据类型 void boolean char unsigned char byte int unsigned int word long unsigned long float double string - char array String - object array,数值,转换 char()

5、 byte() int() word() long() float(),数值,变量范围与限定符 variable scope static volatile const Utilities sizeof(),函数,数字 I/O pinMode() digitalWrite() digitalRead(),模拟 I/O,analogReference() analogRead() analogWrite() - PWM,高级 I/O,tone() noTone() shiftOut() shiftIn() pulseIn(),时间,millis() micros() delay() delayMicroseconds(),数学,min() max() abs() constrain() map() pow() sqrt(),三角函数,sin() cos() tan(),随机数,randomSeed() random(),位与字节,lowByte() highByte() bitRead() bitWrite() bitSet() bitClear() bit(),外部中断,attachInterrupt() detachInterrupt(),通信,Serial Stream,USB(仅适用于Leonardo、Due、Micro),Keyboard Mouse,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报