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:

Wolfram Research (2014), DeviceWriteBuffer, Wolfram Language function, https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html.

Text

Wolfram Research (2014), DeviceWriteBuffer, Wolfram Language function, https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html.

CMS

Wolfram Language. 2014. "DeviceWriteBuffer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html.

APA

Wolfram Language. (2014). DeviceWriteBuffer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html

BibTeX

@misc{reference.wolfram_2024_devicewritebuffer, author="Wolfram Research", title="{DeviceWriteBuffer}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_devicewritebuffer, organization={Wolfram Research}, title={DeviceWriteBuffer}, year={2014}, url={https://reference.wolfram.com/language/ref/DeviceWriteBuffer.html}, note=[Accessed: 21-November-2024 ]}