收藏 分销(赏)

ARDUINO编程语法基础省公共课一等奖全国赛课获奖课件.pptx

上传人:快乐****生活 文档编号:2989184 上传时间:2024-06-12 格式:PPTX 页数:25 大小:111.76KB 下载积分:10 金币
下载 相关 举报
ARDUINO编程语法基础省公共课一等奖全国赛课获奖课件.pptx_第1页
第1页 / 共25页
ARDUINO编程语法基础省公共课一等奖全国赛课获奖课件.pptx_第2页
第2页 / 共25页


点击查看更多>>
资源描述
ARDUINO 编程语法基础第1页结构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);第2页控制结构ifif.elseforswitch casewhiledo.whilebreakcontinuereturngoto第3页语法;(分号)(大括号)/(胆寒注释)/*/(多汗注释)#define#include第4页算术运算符=(assignment operator)+(addition)-(subtraction)*(multiplication)/(division)%(modulo)第5页比较运算符=(equal to)!=(not equal to)(greater than)=(greater than or equal to)第6页布尔运算符&(and)|(or)!(not)第7页指针运算符*dereference operator&reference operator第8页位运算符&(bitwise and)|(bitwise or)(bitwise xor)(bitwise not)(bitshift right)第9页复合运算符+(increment)-(decrement)+=(compound addition)-=(compound subtraction)*=(compound multiplication)/=(compound division)&=(compound bitwise and)|=(compound bitwise or)第10页数值数值常量HIGH|LOWINPUT|OUTPUT|INPUT_PULLUPtrue|falseinteger constantsfloating point constants第11页数值数值数据类型voidbooleancharunsigned charbyteintunsigned intwordlongunsigned longfloatdoublestring-char arrayString-objectarray第12页数值数值转换char()byte()int()word()long()float()第13页数值数值变量范围与限定符variable scopestaticvolatileconstUtilitiessizeof()第14页函数函数数字数字 I/OpinMode()digitalWrite()digitalRead()第15页模拟模拟 I/OanalogReference()analogRead()analogWrite()-PWM第16页高级高级 I/Otone()noTone()shiftOut()shiftIn()pulseIn()第17页时间时间millis()micros()delay()delayMicroseconds()第18页数学数学min()max()abs()constrain()map()pow()sqrt()第19页三角函数三角函数sin()cos()tan()第20页随机数随机数randomSeed()random()第21页位与字节位与字节lowByte()highByte()bitRead()bitWrite()bitSet()bitClear()bit()第22页外部中止外部中止attachInterrupt()detachInterrupt()第23页通信通信SerialStream第24页USB(仅适合用于(仅适合用于Leonardo、Due、Micro)KeyboardMouse第25页
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 教育专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服