Code Monkey home page Code Monkey logo

micropython-bmp280's People

Contributors

dafvid avatar mobley-m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

micropython-bmp280's Issues

swap t_os and p_os

Line 54-55 in bmp280.py is :

_BMP280_OS_MATRIX = [
    [BMP280_PRES_OS_1, BMP280_TEMP_OS_1, 7],

But line 315 is:

        t_os, p_os, self.read_wait_ms = _BMP280_OS_MATRIX[oss]

t_os and p_os should be swapped. Line 316 and 317 are correct. Bits 7-5 are osrs_t and bits 4-2 are osrs_p according to the datasheet of bmp280.
The following patch should be able to fix this issue:

--- bmp280.py.orig	2022-04-26 06:07:08.000000000 +0800
+++ bmp280.py	2022-05-02 06:43:07.000000000 +0800
@@ -312,11 +312,11 @@
     def use_case(self, uc):
         assert 0 <= uc <= 5
         pm, oss, iir, sb = _BMP280_CASE_MATRIX[uc]
-        t_os, p_os, self.read_wait_ms = _BMP280_OS_MATRIX[oss]
+        p_os, t_os, self.read_wait_ms = _BMP280_OS_MATRIX[oss]
         self._write(_BMP280_REGISTER_CONFIG, (iir << 2) + (sb << 5))
         self._write(_BMP280_REGISTER_CONTROL, pm + (p_os << 2) + (t_os << 5))
 
     def oversample(self, oss):
         assert 0 <= oss <= 4
-        t_os, p_os, self.read_wait_ms = _BMP280_OS_MATRIX[oss]
+        p_os, t_os, self.read_wait_ms = _BMP280_OS_MATRIX[oss]
         self._write_bits(_BMP280_REGISTER_CONTROL, p_os + (t_os << 3), 2)

Move constants to constants.py

When I added all the constants from the spec the file grew quite a bit. I'm considering seperating them into a separate file you can use if you need them. This would reduce the file so that it can be more easily used on SoC with restricted storage.

Fehlermeldeung bei bus = I2C()

Hallo,
vorab bin Anfänger!, also nehmt mir mir meine Unwissenheit nicht allzu übel.
Erfasse mit einem ESP32 und einem BMP280 die Temperatur. Bin aber nicht zufrieden mit den Meßergebnissen. Nun bich ich auf dieses Programm gestossen.
habe bisher I2C wie folgt aufgerufen:

i2c0_sda = Pin(26)
i2c0_scl = Pin(27)
i2c0 = I2C(0, sda = i2c0_sda, scl = i2c0_scl, freq = 10000)

und den Sensor:
bmp280_i2c = BMP280I2C(0x77, i2c0)

Wenn ich diesen Code aufrufe, erscheint schon bei:
bus = I2C()
eine Fehlermeldung:
TypeError: 'scl' argument required
Wie gesagt Anfänger!!!
Sicherlich muß ich noch Werte für das Argument eingeben, blos welche?

Gruß Klaus

Raspberry Pico

Hi, I get the following error when using the example code in RPi Pico:

Traceback (most recent call last): File "<stdin>", line 10, in <module> File "bmp280.py", line 97, in __init__ File "bmp280.py", line 126, in _read OSError: 5

The bmp280 is visible with i2c.scan()

Also the example code should have
import bmp280

otherwise the variables are not loaded, only the class.

Typo in use_case argument to constructor?

if use_case is None:

Looking through the code base as I'm looking for a package that does what I expect I saw this line and wondered if it should read:

        if use_case is not None:
            self.use_case(use_case)

I haven't tested either way yet, that is on the plan for tomorrow...

EDIT:
Apologies I didn't see #3 conversation. Will move to conversation on the PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.