Skip to main content

Programmatically control Norsonic Nor1029

Project description

nor1029-controller

Programmatically control the Norsonic Nor265 microphone boom / turntable

Install

pip install nor1029-controller

Usage

from nor1029_controller import Nor265

with Nor265('/dev/serial.0') as nor:
    nor.rotate(180, speed=10, acceleration=2)

API

Nor265(port)

port

The serial port to connect to.

nor

Nor265 instance.

.angle

readonly

Optional parameters will default to whatever was previously set.

.rotate(angle, speed?, acceleration?)

.rotate_relative(angle, speed?, acceleration?)

.start_sweep(start_angle, stop_angle, period, acceleration?)

Oscillate between two angles.

.start_continuous_rotation(direction, speed?, acceleration?)

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()

.start_rotate(angle, speed?, acceleration?)

.start_rotate_relative(angle, speed?, acceleration?)

The start_* methods will return when the movement starts, while the regular methods will also wait for the movement to finish.

.stop()

Stop any ongoing movement.

.go_home()

Rotate back to the home position.

.is_moving

readonly

.close()

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_stopped(timeout?, poll_interval?)

Wait until it is not moving.

.rotate() and .rotate_relative() do this automatically.

timeout

The maximum time to wait in seconds.

Default: None (no timeout)

poll_interval

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)

list_ports()

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)

RotationDirection

Enum

  • CLOCKWISE
  • COUNTER_CLOCKWISE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nor1029_controller-0.5.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nor1029_controller-0.5.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file nor1029_controller-0.5.0.tar.gz.

File metadata

  • Download URL: nor1029_controller-0.5.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for nor1029_controller-0.5.0.tar.gz
Algorithm Hash digest
SHA256 018c264070d8f887f9f32124436d2bc55d1b896b89003cb2ca1f228e00c514f1
MD5 571e550e9e0fee6945c574cae7f1227f
BLAKE2b-256 9b1d6ee581dae220ed2cff3cdc1bec8b019acdcbcf3bb57c439aea858c1ac40f

See more details on using hashes here.

File details

Details for the file nor1029_controller-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nor1029_controller-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2b472b54c97b0ea8885b9ec971b12b47f5dd4b98724cb82d4ee81c8e56fe4f7
MD5 dded7c32e66c2570f39395365392be3b
BLAKE2b-256 f6373426508c56f625981de7224b1ab431b9b77a5a4cb39e9540b931dc8383db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page