Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Writes the specified characters to the stream. This method can support either a string or an roByteArray. If the block is a string, any null bytes will terminate the block.

...

This example script waits for a serial event and echoes the input received on the serial port to the shell:

 

Code Block
serial = CreateObject("roSerialPort", 0, 9600)
p = CreateObject("roMessagePort")
serial.SetLineEventPort(p)

serial_only:
msg = Wait(0,p) ' Wait forever for a message.
if(type(msg) <> "roStreamLineEvent") goto serial_only 'Accept serial messages only.
serial.SendLine(msg) ' Echo the message back to serial.