Skip to content

Adding exit mode before reset #34

Closed
@med1306

Description

@med1306

If you leave python script while measuring the MLX90393 a power-on reset is needed to communicate again with the MLX90393.

For avoid that i just put before the reset command the exit command.

see page 23 in MLX90393-Datasheet-Melexis-953267.pdf
" It is recommended to perform an ‘EX’ command before issuing a ‘RT’ command"

here my implementation
def reset(self) -> None:
"""
Performs a software reset of the sensor.
"""
self.exitMode()

    if self._debug:
        print("Resetting sensor")
    time.sleep(2)
    self._transceive(bytes([_CMD_RT]))
    # burn a read post reset
    try:
        self.magnetic
    except OSError:
        pass
    return self._status_last

def exitMode(self) -> None:
    """
    Performs a Exit to cancel a measurement.
    """
    if self._debug:
        print("Exit mode")
    self._transceive(bytes([_CMD_EX]))
    return self._status_last

MLX90393-Datasheet-Melexis-953267.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions