欢迎来到天天文库
浏览记录
ID:47244275
大小:24.58 KB
页数:5页
时间:2019-08-12
《Arduino语法手册》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Arduino语法手册Arduino的程序可以划分为三个主要部分:结构、变量(变量与常量)、函数。结构部分§setup()§loop()结构控制§if§if...else§for§switchcase§while§do...while§break§continue§return§goto扩展语法§;(分号)§{}(大括号)§//(单行注释)§/**/(多行注释)§#define§#include算数运算符§=(赋值运算符)§+(加)§-(减)§*(乘)§/(除)§%(模)比较运算符§==(等于)§!=(不等于
2、)§<(小于)§>(大于)§<=(小于等于)§>=(大于等于)布尔运算符§&&(与)§
3、
4、(或)§!(非)指针运算符§*取消引用运算符§&引用运算符位运算符§&(bitwiseand)§
5、(bitwiseor)§^(bitwisexor)§~(bitwisenot)§<<(bitshiftleft)§>>(bitshiftright)复合运算符§++(increment)§--(decrement)§+=(compoundaddition)§-=(compoundsubtraction)§*=(compoun
6、dmultiplication)§/=(compounddivision)§&=(compoundbitwiseand)§
7、=(compoundbitwiseor)变量部分常量§HIGH
8、LOW§INPUT
9、OUTPUT§true
10、 false§integerconstants§floatingpointconstants数据类型§void§boolean§char§unsignedchar§byte§int§unsignedint§word§long§unsignedlong§float§double§s
11、tring-chararray§String-object§array-(数组)数据类型转换§char()§byte()§int()§word()§long()§float()变量作用域&修饰符§variablescope§static§volatile§const辅助工具§sizeof()函数部分数字I/O§pinMode()§digitalWrite()§digitalRead()模拟I/O§analogReference()§analogRead()§analogWrite()-PWM高级I/O§ton
12、e()§noTone()§shiftOut()§shiftIn()§pulseIn()时间§millis()§micros()§delay()§delayMicroseconds()数学运算§min()§max()§abs()§constrain()§map()§pow()§sqrt()§ceil()§exp()§fabs()§floor()§fma()§fmax()§fmin()§fmod()§ldexp()§log()§log10()§round()§signbit()§sq()§square()§tru
13、nc()三角函数§sin()§cos()§tan()§acos()§asin()§atan()§atan2()§cosh()§degrees()§hypot()§radians()§sinh()§tanh()随机数§randomSeed()§random()位操作§lowByte()§highByte()§bitRead()§bitWrite()§bitSet()§bitClear()§bit()设置中断函数§attachInterrupt()§detachInterrupt()开关中断§interrupts
14、()§noInterrupts()通讯§Serial§StreamUSB(仅适用于Leonardo和Due)§键盘§鼠标
此文档下载收益归作者所有