Description

Module to send and receive some data via serial port.

Module functions

USerial.open(comName, baudRate, byteSize, parity, stopBits); - open port,
portName - "COM1", "COM2", "COM3"...,
baudRate - 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, 128000, 256000,
byteSize - 8,
parity - (0 - NOPARITY),(1 - ODDPARITY),(2 - EVENPARITY),(3 - MARKPARITY),(4 - SPACEPARITY),
stopBits - (0 - ONESTOPBIT), (1 - ONE5STOPBITS), (2 - TWOSTOPBITS),
USerial.close; - close port,
USerial.write(byte); - write one byte to port,
USerial.writeStr(string); - write string to port,
USerial.writeVec([byte0,byte1,...]); - write multibyte data to port,
USerial.BytesToRead(); - get a number of received bytes,
USerial.read(); - read one byte from port,
USerial.readVec(); - read data vector from port, 
USerial.readStr(); - read data vector from port.

How to use in urbiscript

loadModule("USerial");
var serial=USerial.new;
serial.open("COM1",9600,8,0,0);
serial.writeStr("Hello world");

Download

LINK

 

 

 

EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.9.1, 15.05.2017

FLASH Documentation