ARDUINO编程语法基础.ppt

上传人:牧羊曲112 文档编号:5415604 上传时间:2023-07-05 格式:PPT 页数:25 大小:311.49KB
返回 下载 相关 举报
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页
点击查看更多>>
资源描述

《ARDUINO编程语法基础.ppt》由会员分享,可在线阅读,更多相关《ARDUINO编程语法基础.ppt(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);,控制结构,ifif.elseforswitch casewhi

2、ledo.whilebreakcontinuereturngoto,语法,;(分号)(大括号)/(胆寒注释)/*/(多汗注释)#define#include,算术运算符,=(assignment operator)+(addition)-(subtraction)*(multiplication)/(division)%(modulo),比较运算符,=(equal to)!=(not equal to)(greater than)=(greater than or equal to),布尔运算符,&(and)|(or)!(not),指针运算符,*dereference operator&ref

3、erence operator,位运算符,&(bitwise and)|(bitwise or)(bitwise xor)(bitwise not)(bitshift right),复合运算符,+(increment)-(decrement)+=(compound addition)-=(compound subtraction)*=(compound multiplication)/=(compound division)&=(compound bitwise and)|=(compound bitwise or),数值,常量HIGH|LOWINPUT|OUTPUT|INPUT_PULLUP

4、true|falseinteger constantsfloating point constants,数值,数据类型voidbooleancharunsigned charbyteintunsigned intwordlongunsigned longfloatdoublestring-char arrayString-objectarray,数值,转换char()byte()int()word()long()float(),数值,变量范围与限定符variable scopestaticvolatileconstUtilitiessizeof(),函数,数字 I/OpinMode()digi

5、talWrite()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(),通信,SerialStream,USB(仅适用于Leonardo、Due、Micro),KeyboardMouse,

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

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号