Skip to main content

No project description provided

Project description

An pydevmgr_core extension for serial communication

Sources are here

Doc to comme


> pip install pydevmgr_serial 

Basic Usage

Bellow is an exemple of implementation of a node that check a value from a Tesla Sensor. An extra configuration argument is added and the fget method is implemented.

from pydevmgr_serial import BaseSerialNode, SerialCom
import time

class TesaNodeConfig(BaseSerialNode.Config):
    type : 'Tesa'
    delay: float = 0.1 
class TesaNode(BaseSerialNode):
    Config = TesaNodeConfig
    def fget(self):'?\r')
        sval =
        val = float(sval)
        return val
# build a standalone node 
tesa_com = SerialCom(port='COM1', baudrate=9600)
tesa = TesaNode(com=tesa_com)
    print( "Position is ", tesa.get() )

One can include the node in device

from pydevmgr_serial import BaseSerialDevice
from pydevmgr_core import NodeAlias

class Tesa(BaseSerialDevice):    
    raw_pos = TesaNode.Prop('raw_pos')
    def scaled_pos(self, raw_pos):
        return 10 + 1.3 * raw_pos    
tesa = Tesa('tesa', com={'port':'COM1'})

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

pydevmgr_serial-0.5.0.tar.gz (3.4 kB view hashes)

Uploaded source

Supported by

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