Skip to content

Instantly share code, notes, and snippets.

@Tamakichi
Created August 11, 2018 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tamakichi/e0c71e8ed613e0c8676f016a4934a30d to your computer and use it in GitHub Desktop.
Save Tamakichi/e0c71e8ed613e0c8676f016a4934a30d to your computer and use it in GitHub Desktop.
豊四季TinyBASIC for Arduino 湿温度センサー AM2320サンプルプログラム
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