Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • main
1 result

Target

Select target project
  • clanglai/tp-lora-cooc
1 result
Select Git revision
  • main
1 result
Show changes
Commits on Source (2)
...@@ -29,7 +29,7 @@ class DTH: ...@@ -29,7 +29,7 @@ class DTH:
def read(self): def read(self):
self.__send_and_sleep(0, 0.019) 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.init(Pin.OPEN_DRAIN)
self.__pin(1) self.__pin(1)
bits = [] bits = []
...@@ -39,7 +39,7 @@ class DTH: ...@@ -39,7 +39,7 @@ class DTH:
if a ==1 and 65 <= b <= 75: if a ==1 and 65 <= b <= 75:
bits.append(1) 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) return DTHResult(DTHResult.ERR_MISSING_DATA, 0, 0)
# Calcul des bytes # Calcul des bytes
......