创客百科

姿势共享,有节操无门槛参与的创客百科,创客动力之源 \ (^_^) /

用户工具

站点工具


en:arduino:libraries:wirerequestfrom

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

en:arduino:libraries:wirerequestfrom [2016/12/25 22:15] (当前版本)
行 1: 行 1:
 +====== Wire.requestFrom() ======
  
 +
 +===== Description =====
 +
 +Used by the master to request bytes from a slave device. The bytes may then be retrieved with the available() and read() functions.
 +
 +As of Arduino 1.0.1, requestFrom() accepts a boolean argument changing its behavior for compatibility with certain I2C devices.
 +
 +If true, requestFrom() sends a stop message after the request, releasing the I2C bus.
 +
 +If false, requestFrom() sends a restart message after the request. The bus will not be released, which prevents another master device from requesting between messages. This allows one master device to send multiple requests while in control.
 +
 +The default value is true.
 +===== Syntax =====
 +
 +Wire.requestFrom(address,​ quantity)
 +\\ Wire.requestFrom(address,​ quantity, stop)
 +===== Parameters =====
 +
 +address: the 7-bit address of the device to request bytes from
 +
 +quantity: the number of bytes to request
 +
 +stop : boolean. true will send a stop message after the request, releasing the bus. false will continually send a restart after the request, keeping the connection active.
 +===== Returns =====
 +
 +None
 +===== See Also =====
 +
 +  * Wire.available()
 +  * Wire.read()
 +[[en:​arduino:​libraries|Reference Home]]
en/arduino/libraries/wirerequestfrom.txt · 最后更改: 2016/12/25 22:15 (外部编辑)