Skip to content
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

ValueError: Object has been deinitialized and can no longer be used. #43

Open
iot-crazy opened this issue Apr 17, 2020 · 4 comments
Open
Labels

Comments

@iot-crazy
Copy link

I'm relatively new to circuitpython, only started yesterday so apologies for any mistake I've made here.

Device: Teensy 4.0
DHT22 connected to pin D15
Powered from 3v3
PULL up resistor on data pin, actually the same circuit I've used successfully on other devices, just moved to the teensy 4.0
Coding on a macbook pro using Mu 1.0.3
adafruit_dht library copied to /lib from the latest library download: adafruit-circuitpython-bundle-5.x-mpy-20200417
No other modules in the lib folder

Code:

import board
import time
import adafruit_dht

print('Initialising...')
dht_device = adafruit_dht.DHT22(board.D15)
time.sleep(2)
print(dht_device)

while True:
    temperature = dht_device.temperature
    humidity = dht_device.humidity
    print(str(temperature))
    print(str(humidity))
    time.sleep(2)

Full serial output:

code.py output:
Initialising...
<DHT22 object at 20209020>
Traceback (most recent call last):
File "code.py", line 12, in
File "adafruit_dht.py", line 242, in temperature
File "adafruit_dht.py", line 187, in measure
File "adafruit_dht.py", line 117, in _get_pulses_pulseio
ValueError: Object has been deinitialized and can no longer be used. Create a new object.

@iot-crazy
Copy link
Author

Text from boot_out.txt

Adafruit CircuitPython 5.2.0 on 2020-04-09; Teensy 4.0 with IMXRT1062DVJ6A

@tannewt
Copy link
Member

tannewt commented Apr 17, 2020

@hierophect Want to take a look at this? It's on iMX RT.

@hierophect
Copy link

hierophect commented Apr 17, 2020

I'll check it out this coming week

@kattni kattni added the bug label May 4, 2020
@liammcirl
Copy link

Seeing same issue on Teensy 4.0 board calling sonar = adafruit_hcsr04.HCSR04(trigger_pin=TRIG_PIN, echo_pin=ECHO_PIN, timeout=1.0)

Anybody made any progress with this? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants