Skip to main content

Library to control Sixteen 0-10V Analog Outputs Card

Project description

Welcome to SM16uout’s documentation!

Install

sudo pip install SM16uout

or

sudo pip3 install SM16uout

Update

sudo pip install SM16uout -U

or

sudo pip3 install SM16uout -U

Initiate class

$ python
Python 3.11.8 (main, Feb 12 2024, 14:50:05) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import SM16uout.SM16uout as m
>>> SM16uout = m()
>>>

Documentation

class SM16uout.SM16uout(stack=0, i2c=1)

Bases: object

Python class to control the Sixteen 0-10V Analog Outputs

  • Parameters:
    • stack (int) – Stack level/device number.
    • i2c (int) – i2c bus number

calib_status()

Get current calibration status of device.

  • Returns: (int) Calib status

get_version()

Get firmware version.

Returns: (int) Firmware version number

get_u_out(channel)

Get 0-10V output channel value in volts.

  • Parameters: channel (int) – Channel number
  • Returns: (float) 0-10V output value

set_u_out(channel, value)

Set 0-10V output channel value in volts.

  • Parameters:
    • channel (int) – Channel number
    • value (float) – Voltage value

cal_u_out(channel, value)

Calibrate 0-10V output channel. Calibration must be done in 2 points at min 5V apart.

  • Parameters:
    • channel (int) – Channel number
    • value (float) – Real(measured) voltage value

get_led(led)

Get led state.

  • Parameters: led (int) – Led number
  • Returns: 0(OFF) or 1(ON)

get_all_leds()

Get all leds state as bitmask.

  • Returns: (int) Leds state bitmask

set_led(led, val)

Set led state.

  • Parameters:
    • led (int) – Led number
    • val – 0(OFF) or 1(ON)

set_all_leds(val)

Set all leds states as bitmask.

  • Parameters: val (int) – Led bitmask

get_rs485()

NOT IMPLEMENTED

set_rs485(modbus, modbusId, baudrate=38400, stopbits=1, parity=0)

Set the RS485 port parameters

  • Parameters:
    • modbus (0/1) – 1: turn ON, 2: turn OFF
    • modbusId (1..254) –
    • baudrate (1200..115200) – baud rate (default: 38400)
    • stopbits (1/2) – stop bits (default: 1)
    • parity (0/1/2) – stop bits (default: 0 - None)

disable_rs485()

Disable modbus and free the RS485 for Raspberry usage

wdt_reload()

Reload watchdog.

wdt_get_period()

Get watchdog period in seconds.

  • Returns: (int) Watchdog period in seconds

wdt_set_period(period)

Set watchdog period.

  • Parameters: period (int) – Channel number

wdt_get_init_period()

Get watchdog initial period.

  • Returns: (int) Initial watchdog period in seconds

wdt_set_init_period(period)

Set watchdog initial period.

  • Parameters: period (int) – Initial period in second

wdt_get_off_period()

Get watchdog off period in seconds.

  • Returns: (int) Watchfog off period in seconds.

wdt_set_off_period(period)

Set off period in seconds

  • Parameters: period (int) – Off period in seconds

wdt_get_reset_count()

Get watchdog reset count.

  • Returns: (int) Watchdog reset count

wdt_clear_reset_count()

Clear watchdog counter.

get_button()

Get button status.

  • Returns: (bool) status : True(ON)/False(OFF)

get_button_latch()

Get button latch status.

  • Returns: (bool) status : True(ON)/False(OFF)

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

SM16uout-1.0.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distributions

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

sm16uout-1.0.1-py2.py3-none-any.whl (14.8 kB view details)

Uploaded Python 2Python 3

SM16uout-1.0.1-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file SM16uout-1.0.1.tar.gz.

File metadata

  • Download URL: SM16uout-1.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for SM16uout-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a20acead14e1704ba55b54c16535a45c90bd06197d93030fb69c06e04007f778
MD5 502f8ac410d8422edb8920f5ab726008
BLAKE2b-256 7175c8caaf460ac3fb4c5f36900e6be78acf7f2cd8959339d078000a93c5cf06

See more details on using hashes here.

File details

Details for the file sm16uout-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: sm16uout-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.2

File hashes

Hashes for sm16uout-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a4c8388e4f1a9451f50c2f601232d9f785e8d05d9755422d8704c2d976bea0d9
MD5 9c7d7c2c89d04fe0397894d741559786
BLAKE2b-256 37107dc01383fd546652ddc029ec539b17d3a8c0066b517dc9f22c01d0f1208e

See more details on using hashes here.

File details

Details for the file SM16uout-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: SM16uout-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.2

File hashes

Hashes for SM16uout-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 435fc7d3964f61783c9a5569a5d4d2bd25abc46cc18132fa9f745d5fbcd537da
MD5 a6b30ec18c0f7705e0f145a6502c58af
BLAKE2b-256 42f181acfa47ef6297aa714636938fe583bf72f139cdbf9ad3e1217e1d7b53c5

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