Skip to content

Spinner

This module holds the spinner class.

CLASS DESCRIPTION
Spinner

Spinner class

Multi_Spinner

Ensemble of spinner tools

Documentation last updated: 2025-02-22

Spinner

Spinner(
    port: str,
    *,
    baudrate: int = 9600,
    verbose=False,
    **kwargs,
)

Bases: TimedDeviceMixin, Maker

Spinner class

ATTRIBUTE DESCRIPTION
target_rpm

target rpm of the spinner

TYPE: int

timer_event

event for timer

TYPE: Event

threads

threads for the spinner

TYPE: dict

METHOD DESCRIPTION
soak

soak the spinner

spin

spin the spinner

stop

stop the spinner

setSpinSpeed

set the spin speed

setValue

set the spin speed

execute

execute the soak and spin steps

shutdown

shutdown procedure for the spinner

Initialize the spinner

PARAMETER DESCRIPTION
port

port to connect to

TYPE: str

baudrate

baudrate of the connection. Defaults to 9600.

TYPE: int DEFAULT: 9600

verbose

verbosity of the class. Defaults to False.

TYPE: bool DEFAULT: False

execute

execute(
    soak_time: int | float = 0,
    spin_speed: int = 2000,
    spin_time: int | float = 1,
    blocking: bool = True,
    *args,
    **kwargs,
)

Execute the soak and spin steps

PARAMETER DESCRIPTION
soak_time

soak time. Defaults to 0.

TYPE: int DEFAULT: 0

spin_speed

spin speed. Defaults to 2000.

TYPE: int DEFAULT: 2000

spin_time

spin time. Defaults to 1.

TYPE: int DEFAULT: 1

blocking

whether to block the thread. Defaults to True.

TYPE: bool DEFAULT: True

setSpinSpeed

setSpinSpeed(rpm: int, event: Event | None = None) -> bool

Set the spin speed in rpm

PARAMETER DESCRIPTION
rpm

spin speed in rpm

TYPE: int

event

event to set. Defaults to None.

TYPE: Event DEFAULT: None

RETURNS DESCRIPTION
bool

whether the command was successful

TYPE: bool

setValue

setValue(value: int, event: Event | None = None) -> bool

Set the spin speed in rpm

PARAMETER DESCRIPTION
value

spin speed in rpm

TYPE: int

event

event to set. Defaults to None.

TYPE: Event DEFAULT: None

RETURNS DESCRIPTION
bool

whether the command was successful

TYPE: bool

soak

soak(duration: int | float, blocking: bool = True)

Soak the spinner for a given duration

PARAMETER DESCRIPTION
duration

soak time in seconds

TYPE: int

blocking

whether to block the thread. Defaults to True.

TYPE: bool DEFAULT: True

spin

spin(
    rpm: int, duration: int | float, blocking: bool = True
)

Spin the spinner at a given speed

PARAMETER DESCRIPTION
rpm

spin speed in rpm

TYPE: int

duration

spin time in seconds

TYPE: int

blocking

whether to block the thread. Defaults to True.

TYPE: bool DEFAULT: True

stop

stop()

Stop the spinner