Skip to content

Commit feab7a0

Browse files
committed
dht22 fix
1 parent 3026932 commit feab7a0

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎arch/esp8266/bin/codeloadserial.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import time
44

55
port = serial.Serial(
6-
port='COM4',
6+
port='COM6',
77
baudrate=115200,
88
parity=serial.PARITY_NONE,
99
stopbits=serial.STOPBITS_ONE,
@@ -22,7 +22,7 @@ def upload(path):
2222
if not line: continue
2323
if len(line) > 128:
2424
raise 'Line is too long: %s' % (line)
25-
#print('sending: ' + line)
25+
print('sending: ' + line)
2626
port.write(line)
2727
port.write('\n')
2828
response_buffer = []

‎arch/esp8266/forth/dht22.forth‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ exception: ECHECKSUM
7979

8080
: convert ( lsb-byte msb-byte -- value )
8181
{ hex: 7F and 8 lshift or } keep
82-
dup 128 and 0= if
83-
drop
84-
else
82+
128 and 0<> if
8583
0 swap -
8684
then ;
8785

‎arch/esp8266/forth/examples/example-dht22-data-logger.forth‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variable: server
77
['] dht-measure catch ?dup 0<>
88
if
99
ex-type cr
10-
4000 ms
10+
5000 ms
1111
else
1212
unloop exit
1313
then
@@ -25,8 +25,11 @@ variable: server
2525
['] send catch dispose throw ;
2626

2727
: log-measurement ( -- )
28-
{ measure log } catch ?dup 0<>
29-
if
28+
{
29+
measure
30+
2dup log 500 ms log
31+
}
32+
catch ?dup 0<> if
3033
ex-type cr
3134
then ;
3235

0 commit comments

Comments
 (0)