DeviceWriteBuffer

DeviceWriteBuffer[device,vals]

fills the buffer on a device with the values vals.

DeviceWriteBuffer[device,paramvals]

fills the buffer associated with the parameter param with the values vals.

DeviceWriteBuffer[device,{param1vals1,param2vals2,}]

fills the buffers associated with the parami with the corresponding values valsi .

Details

  • A device can be specified either by a DeviceObject or by a string representing a device class.
  • DeviceWriteBuffer is a blocking function; when called, it communicates with the device and does not return until it has finished writing data.
  • DeviceWriteBuffer[device,vals] returns vals, even if for some reason the write operation fails.

Examples

open allclose all

Basic Examples  (2)

Write a list of strings to the buffer of a demo device and retrieve the result:

Close the device:

Write a list of values to the buffer associated with a specified parameter:

Read the buffer to verify successful writing:

Applications  (2)

Open a serial connection to an Arduino running a custom program called sketch:

Write a string to the device buffer to light up an LED connected to the Arduino board:

Write a sequence of bytes to temporarily put a Sphero robotic ball in the sleep mode:

Introduced in 2014
 (10.0)