Created
August 11, 2018 21:50
-
-
Save Tamakichi/e0c71e8ed613e0c8676f016a4934a30d to your computer and use it in GitHub Desktop.
豊四季TinyBASIC for Arduino 湿温度センサー AM2320サンプルプログラム
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 'AM2320 | |
20 CLS | |
30 A=$5C | |
40 B=MEM | |
50 POKE B,$03,$00,$04 | |
60 W=I2CW(A,B,0,B,0) | |
70 R=I2CR(A,B,3,B+3,8) | |
80 IF R ?"ERROR":GOTO 60 | |
90 H=PEEK(B+5)*256+PEEK(B+6) | |
100 T=PEEK(B+7)*256+PEEK(B+8) | |
110 ?"H ";H/10;"% "; | |
120 ?"T ";T/10;"C" | |
130 WAIT 150 | |
140 GOTO 60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment