Skip to content
Snippets Groups Projects
Commit feddb302 authored by LANGLAIS Charlotte's avatar LANGLAIS Charlotte
Browse files

commentaires ajoutes

parent 5bf7c472
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ class DTH:
def read(self):
self.__send_and_sleep(0, 0.019)
data = pycom.pulses_get(self.__pin,100)
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:
if a ==1 and 65 <= b <= 75:
bits.append(1)
if len(bits) != 40:
if len(bits) != 40: #the number of bits read must be exactly 40, i.e. 5 bytes
return DTHResult(DTHResult.ERR_MISSING_DATA, 0, 0)
# Calcul des bytes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment