FTSCSmotorlist

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Serial-Robotics
Introduced first in SolidGeometry 5.4, Creation date: 2024-04-09, Last change: 2025-09-15

Searches for Motor ID connected to the FeeTEch URT-1 Board after opening the serial port

Description

This function simple pings the motor IDs 0:250 to find connected motors. This function is used in FTSCScmdfindserial


See Also: FTSCScmd , FTSCSdata , FTSCScmdfindserial

Example Illustration

 missing image of FTSCSmotorlist(COM1)

Syntax

ID=FTSCSmotorlist(COM1)

Input Parameter

COM1: Already Open Serial Port

Output Parameter

ID: array of IDs

Examples


COM1=serialport("/dev/cu.usbserial-840",115200)
ID=FTSCSmotorlist(COM1)




Copyright 2024-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, FTSCSmotorlist, is designed to identify motor IDs connected to a FeeTEch URT-1 Board via a serial port. It systematically pings potential motor IDs ranging from 0 to 250 to determine which motors are connected.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize an empty cell array ID and a counter k to zero.
  2. Iterate over a range of potential motor IDs from 0 to 250.
  3. For each ID, display the progress using showprogress function.
  4. Generate a command using FTSCScmd with the current ID, and write this command to the serial port COM1.
  5. Pause for 3 milliseconds to allow the motor to respond.
  6. Check if there are any bytes available to read from the serial port.
  7. If bytes are available, read them and process the response using FTSCSdata to extract the motor ID.
  8. Increment the counter k and store the detected ID in the ID array.
  9. After completing the loop, convert the cell array ID to a regular array and return it.

Example Usage

To use this function, first open a serial port connection:

COM1 = serialport("/dev/cu.usbserial-840", 115200);
ID = FTSCSmotorlist(COM1);

This example opens a serial port at a baud rate of 115200 and then calls FTSCSmotorlist to find connected motor IDs.

Algorithm explaination created using ChatGPT on 2025-08-19 00:12. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21