Welcome to SM8crt’s documentation!
Install
sudo pip install SM8crt
or
sudo pip3 install SM8crt
Update
sudo pip install SM8crt -U
or
sudo pip3 install SM8crt -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 SM8crt
>>> sm = SM8crt.SM8crt()
>>> sm.set_led(2, 1) # Set LED 2 to ON
>>>
Documentation
class SM8crt.SM8crt(stack=0, i2c=1)
Bases: object
Python class to control the 8crt Card for Raspberry Pi.
- Parameters:
- stack (int) – Stack level/device number.
- i2c (int) – i2c bus number
cal_crt(channel, value)
Calibrate current readings. Calibration must be done in 2 points. The further the points are apart, the more accurate the calibration will be.
- Parameters:
- channel (int) – Channel number
- value (int) – Current(A) value
calib_status()
Get current calibration status of device.
- Returns: (int) Calib status
get_all_leds()
Get all leds state as bitmask.
- Returns: (int) Leds state bitmask
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)
get_crt(channel)
Read the instantenous current(A) of one input channel.
- Parameters: channel (int) – Channel number [1..8]
- Returns: (float) Current value in amperes(A)
get_crt_range(channel)
Get the full scale range for a current sensor.
- Parameters: channel (int) – Channel number [1..8]
- Returns: (int) Full scale range in amperes(A)
get_crt_rms(channel)
Read the RMS current(A) of one input channel.
- Parameters: channel (int) – Channel number [1..8]
- Returns: (float) RMS current value in amperes(A)
get_crt_sensor_type(channel)
Get the type of current sensor.
Type 0 = 2.5V +/- 0.625V Type 1 = 2.5V +/- 1V
- Parameters: channel (int) – Channel number [1..8]
- Returns: (int) 0 or 1 indicating sensor type
get_led(led)
Get led state.
- Parameters: led (int) – Led number
- Returns: 0(OFF) or 1(ON)
get_rtc()
Get rtc time.
- Returns: (tuple) date(year, month, day, hour, minute, second)
get_version()
Get firmware version.
Returns: (int) Firmware version number
set_all_leds(val)
Set all leds states as bitmask.
- Parameters: val (int) – Led bitmask
set_crt_range(channel, value)
Set the full scale range for a current sensor.
- Parameters:
- channel (int) – Channel number [1..8]
- value (int) – Full scale range in amperes(A) [1..300]
set_crt_sensor_type(channel, sensor_type)
Set the type of current sensor.
Type 0 = 2.5V +/- 0.625V Type 1 = 2.5V +/- 1V
- Parameters:
- channel (int) – Channel number [1..8]
- sensor_type (int) – 0 or 1 indicating sensor type
set_led(led, val)
Set led state.
- Parameters:
- led (int) – Led number
- val – 0(OFF) or 1(ON)
set_rtc(year, month, day, hour, minute, second)
Set rtc time.
- Parameters:
- year (int) – current year
- month (int) – current month
- day (int) – current day
- hour (int) – current hour
- minute (int) – current minute
- second (int) – current second
wdt_clear_reset_count()
Clear watchdog counter.
wdt_get_init_period()
Get watchdog initial period.
- Returns: (int) Initial watchdog period in seconds
wdt_get_off_period()
Get watchdog off period in seconds.
- Returns: (int) Watchdog off period in seconds.
wdt_get_period()
Get watchdog period in seconds.
- Returns: (int) Watchdog period in seconds
wdt_get_reset_count()
Get watchdog reset count.
- Returns: (int) Watchdog reset count
wdt_reload()
Reload watchdog.
wdt_set_init_period(period)
Set watchdog initial period.
- Parameters: period (int) – Initial period in second
wdt_set_off_period(period)
Set off period in seconds
- Parameters: period (int) – Off period in seconds
wdt_set_period(period)
Set watchdog period.
- Parameters: period (int) – Watchdog period in seconds
Metadata
Release files for SM8crt 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| SM8crt-0.1.0.tar.gz | 6.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| SM8crt-0.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 17.7 kB
Release files / SM8crt-0.1.0.tar.gz
| Download URL | SM8crt-0.1.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e65d22fa2b07d5539dc3d736909c228f7b687534ade09f4b335629d642f37cf1
|
|
BLAKE2b-256 checksum How to use checksums |
6a9f8e468286ce9148be76d32ea0145d8ebb41259a2848f9a3a2c5f7c47a8d5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.2
|
Release files / SM8crt-0.1.0-py2.py3-none-any.whl
| Download URL | SM8crt-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
fb19f1afa78a0ec2b5ef817c3699cc93bee75cfa75a28e84c7369ca58cf34174
|
|
BLAKE2b-256 checksum How to use checksums |
8b93374936b6e1b48550670163ba5e0da6009059573b4f7f17507e114e6dd1dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.2
|