by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Serial-Robotics
Introduced first in SolidGeometry 5.4, Creation date: 2024-04-03, Last change: 2025-09-15
See Also: FTSCScmd
, FTSCSmotorlist
, FTSCScmdfindserial
data=FTSCSdata(datarec,[typ])
datarec: | data received from the URT-1 board by the read function; cell array if there are several answers | |
typ: | data type such 'unit8' or 'uint16', default is 'uint8' |
data: | data in the type format |
COM1=serialport("/dev/cu.usbserial-840",115200)
[a,b]=FTSCScmd(1,21,'',2,3) % read 3 data sets for PID of motor 1
write(COM1,a,'uint8'); % 'unit8' is mandatory for URT-1 Board
zz=read(COM1,COM1.NumBytesAvailable,'uint8') % 'unit8' is mandatory for URT-1 Board
FTSCSdata(zz,'unit8') % some parameters are uint8 some are uint16