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

2020/07/09 15:05:06

MixJuice GET URL : kidspod.club/mj/988

DS1307+ AQM0802A 液晶時計プログラム

DS1307+とAQM0802Aを
まとめて一つのプログラムにしました。

  • 1
  • 1

SOURCE CODE

  1. パンク0
  2.  
  3. 10 'AQM0802A LCD DRIVE CAA45040
  4. 20 '0X00,0X38 FUNCTION SET
  5. 30 '0X00,0X39 FUNCTION SET
  6. 40 '0X00,0X04 ENTRY MODE SET
  7. 50 '0X00,0X14 INTERNAL OSC FRE
  8. 60 '0X00,0X73 CONTRAST SET
  9. 70 '0X00,0X5E POW/ICON/CONTRAST
  10. 80 '0X00,0X6C FOLLOWER CONTROL
  11. 100 '0X00,0X38 FUNCTION SET
  12. 110 '0X00,0X0C DISPLAY ON/OFF
  13. 120 '0X00,0X01 CLEAR DISPLAY
  14. 130 '0X80,0X00 SET CURSOR 0,0
  15. 140 '0X40,'O','N' "ON"
  16. 150 '0X80,0X40 SET CURSOR 0,1
  17. 160 '0X40,'L','C','D' "LCD"
  18. 200 'ON LCD
  19. 210 POKE #700,#0,#38,#0,#39,#0,#04,#0,#14,#0,#70,#0,#56,#0,#6C,#0,#38,#0,#C,#0,#1
  20. 220 FOR I = 0 TO 9
  21. 230 ?"#700+";:?I*2;:?".";:?HEX$(PEEK(#700+I*2));:?".";:?HEX$(PEEK(#701+I*2))
  22. 240 R=I2CW(#3E,#700+I*2,2)
  23. 250 NEXT
  24. 260 ?"INT":WAIT 120:?"ON LCD"
  25. 270 R=I2CW(#3E,"@ON LCD",7)
  26. 280 ?"LRUN 1":WAIT 120
  27. 290 LRUN 1
  28.  
  29.  
  30. save 0
  31.  
  32. バンク1
  33.  
  34. 10 'GOTO 100:'DS1307 AQM0802
  35. 20 H=0:M=0
  36. 30 INPUT "H 0-23>",H
  37. 40 INPUT "M 0-59>",M
  38. 50 A=(M/10)*16+(M%10)
  39. 60 B=(H/10)*16+(H%10)
  40. 70 POKE #700,0,0,A,B,3,1,1,#20
  41. 80 R=I2CW(#68,#700,1,#701,7)
  42. 90 'READ
  43. 100 POKE #700,0,1
  44. 110 R=I2CW(#3E,#700,2)
  45. 120 POKE #700,0
  46. 130 R=I2CR(#68,#700,1,#701,7)
  47. 140 FOR I=3 TO 1 STEP -1
  48. 150 ?HEX$(PEEK(#700+I));
  49. 160 R=PEEK(#700+I)
  50. 170 A=R/16:B=R%16
  51. 180 '?".";:?A;:?B;:?".";
  52. 190 POKE #720,64,48+A,48+B:R=I2CW(#3E,#720,3)
  53. 200 IF I<>1 THEN ?":";
  54. 210 IF I<>1 THEN R=I2CW(#3E,"@:",2)
  55. 220 NEXT
  56. 230 WAIT 60:?
  57. 240 GOTO 100
  58.  
  59.  
  60. save 1
  61.  
  62.  
  63.  

COMMENT

S