- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
这是精心收集的精品经典资料,值得下载保存阅读!
arduino基础-函数(arduino基础 - 函数)
Input output function
Arduino contains a switching function of some processing input and output, is believed to have the book from a program example.
PinMode (pin, mode)
Specifies the digital foot (digital, pin) as input or output.
Example:
PinMode (7, INPUT); / / pin 7 is set as input mode
DigitalWrite (pin, value)
Specifies the number of pins to be on or off. The pin must first be passed through the pinMode as input or output mode, and the digitalWrite will take effect.
Example:
DigitalWrite (8, HIGH); / / set the high potential output pin 8
Int digitalRead (PIN)
Read the value of the input pin and return HIGH when it is sensed that the foot is at high potential. Otherwise, it will return LOW.
Example:
Val = digitalRead (7); / / read pin 7 values and assigned to val
Int analogRead (PIN)
Read the voltage of the analog foot and return a value from 0 to 1023 to indicate the corresponding 0 to 5 voltage value.
Example:
Val = analogRead (0); / / read analog pin 0 values and assigned to the variable val
AnalogWrite (pin, value)
Change the output voltage of the PWM pin, and the feet are usually at 3, 5, 6, 9, 10 and 11. The Value range is 0-255, for example, the output voltage is 2.5 volts (V), and the value is about 128.
Example:
AnalogWrite (9128); / / output voltage of about 2.5 volts (V)
Unsigned, long, pulseIn (pin, value)
Sets the duration of the read position of the foot, for example, when an infrared or accelerometer is used to measure a certain value, without changing the state in the time unit.
Example:
Time = pulsein (7, HIGH); / / set foot 7 state in the unit of time is HIGH
ShiftOut (dataPin, clockPin, bitOrder, value)
The data is passed to a register used to extend the digital output. The function uses one foot to represent the data and one foot to indicate the pulse. BitOrder is used to represent the movement of bits (the lowest significant bit of LSBFIRST or the most significant bit of MSBFIRST), and finally the value output i
您可能关注的文档
- 机床英文.doc
- 机制过程课程计划.doc
- 机械停车库设计.doc
- 晶粒尺寸图片.doc
- 机械力学力学.doc
- 机械原理测试题目整理.doc
- 机修(带答案).doc
- 朝日双块无碴轨道.doc
- 机械工程材料第3版.doc
- 机动车交通安全讲座.ppt
- arraycollection的filterfunction属性过滤datagrid(The filterfunction attribute filter of DataGrid arraycollection).doc
- atheros无线网卡芯片全介绍(Atheros wireless network card chip introduction).doc
- audition1.5(音频编辑软(audition1.5 (音频编辑软).doc
- autodesk autocad plant 3dpid 2013 三维工厂设计中英文全功能(Autodesk AutoCAD 2013三维工厂设计中英文全功能植物3dpid).doc
- autocad2008视频教程02(autocad2008视频教程02).doc
- avc(AVC).doc
- baf(曝气生物滤池).doc
- bc506 码表中文说明(Table bc506 shows Chinese).doc
- bcm43xx驱动指南(Bcm43xx driver guide).doc
- apache服务器实现用户验证(The Apache server implements user authentication).doc
文档评论(0)