Skip to content

TMP144 Texas Instruments UART #13058

Discussion options

You must be logged in to vote

I just played with TMP144 so I wrote basic class as example

import machine
import time


class PointerAddress:
    TEMPERATURE_REGISTER = 0x0
    CONFIGURATION_REGISTER = 0x2
    T_LOW_REGISTER = 0x4
    T_HIGH_REGISTER = 0x6


class TMP144:
    GLOBAL_RESET = 0xB4
    GLOBAL_INIT = 0x8C
    GLOBAL_ADDRESS_ASSIGNMENT = 0x90
    GLOBAL_CLEAR_INTERRUPT = 0xA9
    CALIBRATION_BYTE = 0x55
    TEMP_FORMAT = 0.0625

    def __init__(self, uart: machine.UART, temperatures_counter: int):
        self.uart = uart
        actual_count = self._init()
        if temperatures_counter != actual_count:
            raise ValueError("Wrong number of temperatures connected!")

    @staticmethod
    def dec…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by coffeemakingtoaster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants