adafruit / adafruit_circuitpython_tmp117 Goto Github PK
View Code? Open in Web Editor NEWCircuitPython library for the TI TMP117 Temperature sensor
License: MIT License
CircuitPython library for the TI TMP117 Temperature sensor
License: MIT License
Once any of the tmp117.averaged_measurements lines are uncommented (seemingly other than the first, which is an average of 1) in the example code, the example code runs for an inconsistent amount of time, but eventually stops supplying new data.
The rate and averaging test seems to work fine.
Tested with two TMP117 breakouts with different Stemma QT cables, on both a Feather M4 and a Feather ESP32-S2 TFT, both with the latest 7.x of CP for each.
Issue:
With CircuitPython 7.3.2 and the latest libraries, the TMP117 cannot be used with the QTPy due to a memory allocation error.
Resolution:
Roll back to CircuitPython 6.3.0 and the TMP117 version 6 library.
I know the QTPy has limited memory, but I would expect this would still work with CP7.
Thanks
Add a Basic DisplayIO Based Example
We would like to have a basic displayio example for this library. The example should be written for microcontrollers with a built-in display. At a minimum it should show a Label on the display and update it with live readings from the sensor.
The example should not be overly complex, it's intended to be a good starting point for displayio based projects that utilize this sensor library. Try to keep all visual content as near to the top left corner as possible in order to best fascilitate devices with small built-in display resolutions.
The new example should follow the naming convention examples/libraryname_displayio_simpletest.py
with "libraryname" being replaced by the actual name of this library.
You can find an example of a Pull Request that adds this kind of example here: adafruit/Adafruit_CircuitPython_BME680#72
We have a guide that covers the process of contributing with git and github: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
If you're interested in contributing but need additional help, or just want to say hi, feel free to join the Discord server to ask questions: https://adafru.it/discord
There are missing type annotations for some functions in this library.
The typing
module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error for missing import. There is an example of how that is done here:
try:
from typing import List, Tuple
except ImportError:
pass
Once imported the typing annotations for the argument type(s), and return type(s) can be added to the function signature. Here is an example of a function that has had this done already:
def wrap_text_to_pixels(
string: str, max_width: int, font=None, indent0: str = "", indent1: str = ""
) -> List[str]:
If you are new to Git or Github we have a guide about contributing to our projects here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
There is also a guide that covers our CI utilities and how to run them locally to ensure they will pass in Github Actions here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code In particular the pages: Sharing docs on ReadTheDocs
and Check your code with pre-commit
contain the tools to install and commands to run locally to run the checks.
If you are attempting to resolve this issue and need help, you can post a comment on this issue and tag both @FoamyGuy and @kattni or reach out to us on Discord: https://adafru.it/discord in the #circuitpython-dev
channel.
The following locations are reported by mypy to be missing type annotations:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.