AM2315
OldMan
Posts: 5
in BASIC Stamp
Hi,
I will use the AM2315 sensor with this BS2Px program, but I receive only 0..5..128..115 always.
What do I do wrong? (with Arduino working fine)
' {$STAMP BS2px}
' {$PBASIC 2.5}
DATA $03, $00, $04
SDA PIN 8
adr CON $B8 'AM2315 addres
t1 VAR Byte
t2 VAR Byte
p1 VAR Byte
p2 VAR Byte
idx VAR Byte
char VAR Byte
Main:
FOR idx = 1 TO 3
READ idx, char
I2COUT SDA, adr, [char]
PAUSE(15)
NEXT
I2CIN SDA, adr,0,[p1, p2, t1, t2]
DEBUG CLS, DEC p1,"..", DEC p2,"..", DEC t1,"..", DEC t2
END
I will use the AM2315 sensor with this BS2Px program, but I receive only 0..5..128..115 always.
What do I do wrong? (with Arduino working fine)
' {$STAMP BS2px}
' {$PBASIC 2.5}
DATA $03, $00, $04
SDA PIN 8
adr CON $B8 'AM2315 addres
t1 VAR Byte
t2 VAR Byte
p1 VAR Byte
p2 VAR Byte
idx VAR Byte
char VAR Byte
Main:
FOR idx = 1 TO 3
READ idx, char
I2COUT SDA, adr, [char]
PAUSE(15)
NEXT
I2CIN SDA, adr,0,[p1, p2, t1, t2]
DEBUG CLS, DEC p1,"..", DEC p2,"..", DEC t1,"..", DEC t2
END
Comments