Programmatically control the Norsonic Nor265 microphone boom / turntable
pip install nor1029-controllerfrom nor1029_controller import Nor265
with Nor265('/dev/serial.0') as nor:
nor.rotate(180, speed=10, acceleration=2)The serial port to connect to.
Nor265 instance.
readonly
Optional parameters will default to whatever was previously set.
Oscillate between two angles.
from nor1029_controller import Nor265, RotationDirection
import time
with Nor265() as nor:
nor.start_continuous_rotation(
direction=RotationDirection.CLOCKWISE,
speed=10,
acceleration=2
)
# Rotate for 5 seconds
time.sleep(5)
nor.stop()The start_* methods will return when the movement starts, while the regular methods will also wait for the movement to finish.
Stop any ongoing movement.
Rotate back to the home position.
readonly
If you're not using a context manager, you should instead call this method when you are done.
from nor1029_controller import Nor265
nor = Nor265('/dev/serial.0')
nor.rotate(180, speed=10, acceleration=2)
nor.close()Wait until it is not moving.
.rotate() and .rotate_relative() do this automatically.
The maximum time to wait in seconds.
Default: None (no timeout)
The interval between each check in seconds.
Default: 0.01 (10 milliseconds)
from nor1029_controller import Nor265
with Nor265('/dev/serial.0') as nor:
nor.start_rotate(180, speed=10, acceleration=2)
# ...
nor.wait_stopped(timeout=10)Scan for available serial ports (according to their description).
from nor1029_controller import Nor265, list_ports
# Pick first serial port
port = list_ports()[0].device
with Nor265(port) as nor:
nor.rotate(180, speed=10, acceleration=2)Enum
CLOCKWISECOUNTER_CLOCKWISE