Search found 15 matches

by quantalume
Thu Sep 22, 2016 7:58 pm
Forum: Drivers for External Components
Topic: Interfacing the DHT11/DHT22 Humidity/Temperature sensor
Replies: 7
Views: 6456

Re: Interfacing the DHT11/DHT22 Humidity/Temperature sensor

I took the liberty of packaging RinusW's code into a single stream. Here are the contents of what I've named dht.py: from machine import enable_irq, disable_irq import time def getval(pin) : ms = [1]*300 pin(0) time.sleep_us(20000) pin(1) irqf = disable_irq() for i in range(len(ms)): ms[i] = pin() #...
by quantalume
Thu Sep 22, 2016 7:42 pm
Forum: Drivers for External Components
Topic: DHT22 / AM2302 library for Wipy
Replies: 21
Views: 2280

Re: DHT22 / AM2302 library for Wipy

The ESP series of modules seems to have a bigger following than the CC3200-based modules. A DHT driver already exists for micropython on the ESP8266, and I imagine there will soon be one for ESP32. Actually, unless you need bluetooth or more processor power, the ESP8266 is pretty much the best micro...
by quantalume
Wed Sep 21, 2016 5:39 pm
Forum: Drivers for External Components
Topic: DHT22 / AM2302 library for Wipy
Replies: 21
Views: 2280

Re: DHT22 / AM2302 library for Wipy

I took a crack at this but was ultimately unsuccessful. The problem is that it takes too long to switch pin modes in Python, and you lose the data before you even get interrupts set up to catch the falling edges. One way around this problem might be to use two pins connected together, one configured...
by quantalume
Wed Sep 21, 2016 5:38 pm
Forum: Drivers for External Components
Topic: Interfacing the DHT11/DHT22 Humidity/Temperature sensor
Replies: 7
Views: 6456

Re: Interfacing the DHT11/DHT22 Humidity/Temperature sensor

This is working again now if you use this version of firmware with multi-threading disabled: https://github.com/robert-hh/Shared-Stuff. Further discussed in this thread: https://forum.micropython.org/viewtopic.php?f=11&t=2127&start=40#p13927
by quantalume
Mon Sep 19, 2016 3:30 pm
Forum: The WiPy and CC3200 boards
Topic: NEW: WiPy 2.0 - shipping 10 Oct 2016
Replies: 62
Views: 8523

Re: NEW: WiPy 2.0 - shipping 10 Oct 2016

How will they differentiate themselves from the throngs of ESP32 boards due out of China any day now?
by quantalume
Wed Sep 14, 2016 6:55 pm
Forum: The WiPy and CC3200 boards
Topic: Failsafe WLAN script
Replies: 0
Views: 575

Failsafe WLAN script

I'm trying to come up with a script that will attempt to connect to the local wireless router in station mode but fall back to access point if unsuccessful. Here is what I have: # main.py -- put your code here! from network import WLAN import time ssid = 'xxxxx' auth = (WLAN.WPA2, 'xxxxxxxx') wlan=W...
by quantalume
Mon Sep 12, 2016 10:34 pm
Forum: Drivers for External Components
Topic: DHT22 / AM2302 library for Wipy
Replies: 21
Views: 2280

Re: DHT22 / AM2302 library for Wipy

I have already checked the driver and realized that the Timer class on Wipy doesn't have the counter method. True; however, his code sets the timer period to 1 uS and counts the number of uS between falling edges. We could do the same with something like this (inside the interrupt handler): times[i...
by quantalume
Mon Sep 12, 2016 6:57 pm
Forum: Drivers for External Components
Topic: DHT22 / AM2302 library for Wipy
Replies: 21
Views: 2280

Re: DHT22 / AM2302 library for Wipy

It should be pretty straightforward to modify the pyb driver for the WiPy as both external interrupts and the Timer class are implemented. I'll take a crack at this in the next few days if nobody beats me to it.
by quantalume
Mon Sep 12, 2016 6:42 pm
Forum: Drivers for External Components
Topic: Interfacing the DHT11/DHT22 Humidity/Temperature sensor
Replies: 7
Views: 6456

Re: Interfacing the DHT11/DHT22 Humidity/Temperature sensor

I was using the OP's code, and it was working reliably, but it is now broken as of MicroPython 1.8.2+. I suspect this has something to do with the support for multi-threading, since the DHT code attempts to disable interrupts in order to clock the data in at a fast-enough rate. The ESP8266 has its o...
by quantalume
Mon Sep 05, 2016 6:58 pm
Forum: ESP8266 boards
Topic: Problems with the DHT example
Replies: 11
Views: 1944

Re: Problems with the DHT example

After rewiring my circuit onto a different proto board, it appears to be working now. Same NodeMCU and same sensor. There must have been a faulty connection. It does not appear to need a pullup resistor; the internal pullup appears to be sufficient, at least for short leads to the sensor.

Go to advanced search