data=pycom.pulses_get(self.__pin,100)#Return a list of pulses at pin. The methods scans for transitions at pin and returns a list of tuples, each telling the pin value and the duration in microseconds of that value.
self.__pin.init(Pin.OPEN_DRAIN)
self.__pin(1)
bits=[]
...
...
@@ -39,7 +39,7 @@ class DTH:
ifa==1and65<=b<=75:
bits.append(1)
iflen(bits)!=40:
iflen(bits)!=40:#the number of bits read must be exactly 40, i.e. 5 bytes