How to use the plotink.ebb_serial.query function in plotink

To help you get started, we’ve selected a few plotink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github evil-mad / plotink / plotink / ebb_motion.py View on Github external
def queryVoltage(port_name):
    # Query the EBB motor power supply input voltage.
    if port_name is not None:
        version_status = ebb_serial.min_version(port_name,"2.2.3")
        if not version_status:
            return True # Unable to read version, or version is below 2.2.3.
                        # In these cases, issue no voltage warning.
        else:
            raw_string = (ebb_serial.query(port_name, 'QC\r'))
            split_string = raw_string.split(",", 1)
            split_len = len(split_string)
            if split_len > 1:
                voltage_value = int(split_string[1])  # Pick second value only
            else:
                return True  # We haven't received a reasonable voltage string response.
                # Ignore voltage test and return.
            # Typical reading is about 300, for 9 V input.
            if voltage_value < 250:
                return False
    return True
github evil-mad / plotink / plotink / ebb_motion.py View on Github external
def QueryPenUp(port_name):
    if port_name is not None:
        pen_status = ebb_serial.query(port_name, 'QP\r')
        if pen_status[0] == '0':
            return False
        else:
            return True
github evil-mad / plotink / plotink / ebb_motion.py View on Github external
def queryEBBLV(port_name):
    # Query the EBB "Layer" Variable, an 8-bit number we can read and write.
    # (Unrelated to our plot layers; name is an historical artifact.)
    if port_name is not None:
        value = ebb_serial.query(port_name, 'QL\r')
        try:
            ret_val = int(value)
            return value
        except:
            return None
github evil-mad / plotink / plotink / ebb_motion.py View on Github external
def QueryPRGButton(port_name):
    if port_name is not None:
        return ebb_serial.query(port_name, 'QB\r')

plotink

Helper routines for use with plotters

MIT
Latest version published 6 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages