Skip to content

Change in the Bitbang Trigger calculation #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2021
Merged

Change in the Bitbang Trigger calculation #62

merged 2 commits into from
Feb 16, 2021

Conversation

jposada202020
Copy link

I have modified the trigger calculation. According to the Intenet there is a difference in the trigger time for the DHT11 and DHT22. This is take into account in the library in the Child classes with the parameter

class DHT11(DHTBase):
    """Support for DHT11 device.
    :param ~board.Pin pin: digital pin used for communication
    """
    def __init__(self, pin, use_pulseio=_USE_PULSEIO):
        super().__init__(True, pin, 18000, use_pulseio)

class DHT22(DHTBase):
    """Support for DHT22 device.

    :param ~board.Pin pin: digital pin used for communication
    """
    def __init__(self, pin, use_pulseio=_USE_PULSEIO):
        super().__init__(False, pin, 1000, use_pulseio)

However, this is not calculated for the Bitbang portion, and the time used is the time normally used for the DHT22 sensor.

Calculation when pulling the line down to start the lecture will be calculated according to the self._trig_wait parameter that depends on the sensor used

            dhtpin.direction = Direction.OUTPUT
            dhtpin.value = True
            time.sleep(0.1)
            dhtpin.value = False
            time.sleep(self._trig_wait // 1000000)  

Old C library different time, maybe that is why for a lot of people this works better. (if interested see this https://github.com/jposada202020/DHT_Investigation)

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find! Thank you!

@tannewt tannewt merged commit 8695a11 into adafruit:master Feb 16, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 24, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_DHT to 3.5.6 from 3.5.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_DHT#62 from jposada202020/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306 to 1.3.0 from 1.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306#19 from SAK917/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_IL0373 to 1.3.6 from 1.3.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_IL0373#21 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_INA260 to 1.3.0 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_INA260#15 from gpongelli/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP2515 to 1.0.4 from 1.0.3:
  > Changed py_modules to packages

Updating https://github.com/adafruit/Adafruit_CircuitPython_SCD30 to 2.0.3 from 2.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_SCD30#10 from caternuson/remove_asc

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1608 to 1.2.5 from 1.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1608#10 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1681 to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1681#3 from makermelissa/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7789 to 1.4.4 from 1.4.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7789#22 from wildestpixel/patch-2

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.3.6 from 3.3.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#26 from caternuson/iss25

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.2.6 from 1.2.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL6180X#17 from OleMchls/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_Gizmo to 1.3.0 from 1.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Gizmo#15 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_MagTag to 1.7.0 from 1.6.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#56 from KTibow/patch-2

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.0.2 from 5.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#69 from dlizotte-uwo/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.2.7 from 3.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#52 from jedgarpark/pico-dc-motor-example

Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.1.6 from 0.1.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#8 from jepler/commas

Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.2.3 from 1.2.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#13 from Neradoc/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_SSD1681
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants