Enjoy programming more!
Kidspod is a post site which supports young programmers.
First step to join us.
Register as a member
For members

2016/05/28 07:05:42

MixJuice GET URL : kidspod.club/mj/83

気温ロガー

i2C温度センサADT7410で温度を取得し一定時間毎に記録します。

  • No registered tag exist.

SOURCE CODE

1 'LOGGER
10 CLS:CLV:D=2:L=(FREE()-2)
20 ?L/60*D;"HOURS":
30 ?HEX$(H,1);
40 A=I2CR(#48,#700,1,#702,2)
50 T=(PEEK(#702)<<8+PEEK(#703))>>4
60 ?A:POKE#1000-H,T:SAVE
70 H=H+1:H=H%L
80 FORI=1TOD
90 IF TICK()<=3600:GOTO90
100 CLT:NEXT
110 GOTO30
200 FORI=0TOL
220 ?PEEK(#1000-I)/8;".";PEEK(#1000-I)%8*10/8;" ";
222 'POKE#1000-I,0
225 IFI%6=5:?
230 IFI%120=119:INPUTN
240 NEXT

COMMENT