パンク0 10 'AQM0802A LCD DRIVE CAA45040 20 '0X00,0X38 FUNCTION SET 30 '0X00,0X39 FUNCTION SET 40 '0X00,0X04 ENTRY MODE SET 50 '0X00,0X14 INTERNAL OSC FRE 60 '0X00,0X73 CONTRAST SET 70 '0X00,0X5E POW/ICON/CONTRAST 80 '0X00,0X6C FOLLOWER CONTROL 100 '0X00,0X38 FUNCTION SET 110 '0X00,0X0C DISPLAY ON/OFF 120 '0X00,0X01 CLEAR DISPLAY 130 '0X80,0X00 SET CURSOR 0,0 140 '0X40,'O','N' "ON" 150 '0X80,0X40 SET CURSOR 0,1 160 '0X40,'L','C','D' "LCD" 200 'ON LCD 210 POKE #700,#0,#38,#0,#39,#0,#04,#0,#14,#0,#70,#0,#56,#0,#6C,#0,#38,#0,#C,#0,#1 220 FOR I = 0 TO 9 230 ?"#700+";:?I*2;:?".";:?HEX$(PEEK(#700+I*2));:?".";:?HEX$(PEEK(#701+I*2)) 240 R=I2CW(#3E,#700+I*2,2) 250 NEXT 260 ?"INT":WAIT 120:?"ON LCD" 270 R=I2CW(#3E,"@ON LCD",7) 280 ?"LRUN 1":WAIT 120 290 LRUN 1 save 0 バンク1 10 'GOTO 100:'DS1307 AQM0802 20 H=0:M=0 30 INPUT "H 0-23>",H 40 INPUT "M 0-59>",M 50 A=(M/10)*16+(M%10) 60 B=(H/10)*16+(H%10) 70 POKE #700,0,0,A,B,3,1,1,#20 80 R=I2CW(#68,#700,1,#701,7) 90 'READ 100 POKE #700,0,1 110 R=I2CW(#3E,#700,2) 120 POKE #700,0 130 R=I2CR(#68,#700,1,#701,7) 140 FOR I=3 TO 1 STEP -1 150 ?HEX$(PEEK(#700+I)); 160 R=PEEK(#700+I) 170 A=R/16:B=R%16 180 '?".";:?A;:?B;:?"."; 190 POKE #720,64,48+A,48+B:R=I2CW(#3E,#720,3) 200 IF I<>1 THEN ?":"; 210 IF I<>1 THEN R=I2CW(#3E,"@:",2) 220 NEXT 230 WAIT 60:? 240 GOTO 100 save 1