libioplus
This is the python library to control the Home Automation Stackable Card for Raspberry Pi.
Install
sudo pip install SMioplus
Usage
Now you can import the megaio library and use its functions. To test, read relays status from the board with stack level 0:
~$ python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libioplus
>>> libioplus.getAdcV(0, 1)
2.654391
>>>
libioplus
Functions
getAdcV(stack, channel)
Return voltage readings on ADC channel (converted to volts)
stack - stack level, set with jumpers [0..7]
channel - ADC channel [1..8]
getAdcRaw(stack, channel)
Return the raw readings on ADC channel (12bits, [0..4095]
stack - stack level, set with jumpers [0..7]
channel - ADC channel [1..8]
setDacV(stack, channel, value)
Set output voltage on one DAC channel
stack - stack level, set with jumpers [0..7]
channel - DAC channel [1..4]
value - DAC voltage [0..10]
setOdPwm(stack, channel, value)
Set PWM value for one Open-Drain channel
stack - stack level, set with jumpers [0..7]
channel - OD channel [1..4]
value - PWM [0..10000]
setRelayCh(stack, channel, value)
Set the output state of one relay
stack - stack level, set with jumpers [0..7]
channel - Relay nr [1..8]
value - 1 = relay on, 0 = relay off
getRelayCh(stack, channel)
Return state of one relay
stack - stack level, set with jumpers [0..7]
channel - Relay nr [1..8]
setRelays(stack, value)
Set all relays 8 bits value
stack - stack level, set with jumpers [0..7]
value [0..255], 0 - all relays OFF; 255 - all relays ON
getRelays(stack)
Return state of all relays, 8 bits value
stack - stack level, set with jumpers [0..7]
getOptoCh(stack, channel)
Return one opto input channel state
stack - stack level, set with jumpers [0..7]
channel - Opto channel nr [1..8]
getOpto(stack)
Return all opto input channels states as 8 bits value
stack - stack level, set with jumpers [0..7]
setGpioDir(stack, dir)
Set all 4 GPIO direction
stack - stack level, set with jumpers [0..7]
dir - 4 bits value : 0 - all output, 15 - all input
getGpio(stack)
Return the GPIO state, 4 bits value
stack - stack level, set with jumpers [0..7]
setGpioPin(stack, pin, val)
Set one GPIO pin state if his direction is output
stack - stack level, set with jumpers [0..7]
pin - pin number [1..4]
val - 0 = low; 1 - high
cfgOptoEdgeCount(stack, channel, state)
Configure the edge counting on a opto coupled input channel
stack - stack level, set with jumpers [0..7]
channel - channel number [1..8]
state - 0 = disble; 1 - count rising edges; 2 - count falling edges; 3 - count both
getOptoCount(stack, channel)
Read the opto edge counter on a channel
stack - stack level, set with jumpers [0..7]
channel - channel number [1..8]
Returns the counter value
rstOptoCount(stack, channel)
Reset the edge counter.
stack - stack level, set with jumpers [0..7]
channel - channel number [1..8]
cfgOptoEncoder(stack, channel, state)
Config the encoder inputs on optocoupled channels. The encoder can be connected on opto 1/2, 3/4, 5/6, 7/8 this means 4 encoders.
stack - stack level, set with jumpers [0..7]
channel - channel number [1..4]
state - 0- disable, 1 - enable
getOptoEncoderCount(stack, channel)
Read the opto encoder counter
stack - stack level, set with jumpers [0..7]
channel - channel number [1..4]
Return 32 bits signed integer represents the counter
resetOptoEncoderCount(stack, channel)
Reset the conter
stack - stack level, set with jumpers [0..7]
channel - channel number [1..4]
owgGetTemp(stack, channel)
Read the temperature of one sensor
stack - stack level, set with jumpers [0..7]
channel - channel number [1..number of connected sensors]
Return temperature in degree Celsius readed from the selected sensor
owbGetSnsNo(stack)
Return the nomber of sensors connected to the one wire port
stack - stack level, set with jumpers [0..7]
owbGetSnsId(stack, channel)
Return the 8 bytes ID of the selected sensor
stack - stack level, set with jumpers [0..7]
channel - channel number [1..number of connected sensors]
owbScam(stack)
Start scaning procedure
stack - stack level, set with jumpers [0..7]
Metadata
Release files for smioplus 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| smioplus-1.0.6.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| smioplus-1.0.6-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / smioplus-1.0.6.tar.gz
| Download URL | smioplus-1.0.6.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4cf30e79603fb6b3c6a961663c0ebdd2d756abca17cf4dd13509bde41f7c1fd
|
|
BLAKE2b-256 checksum How to use checksums |
7dece11818cfe629dee67e577bb02208feadbd0ac15b4752a2b87352e0bfa36b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.2
|
Release files / smioplus-1.0.6-py2.py3-none-any.whl
| Download URL | smioplus-1.0.6-py2.py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
91624d33bbf3fa0561ed33842ed2dccb5f41524b3b194dfba3420a810f25d245
|
|
BLAKE2b-256 checksum How to use checksums |
c2f5b899108f43fc88ad292b0985d2529ecd5446dcc11419ea2f08ab91be2f72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.2
|