{"id":6346,"date":"2024-01-04T23:04:50","date_gmt":"2024-01-04T14:04:50","guid":{"rendered":"https:\/\/kats-eye.net\/info\/?p=6346"},"modified":"2024-01-07T12:35:36","modified_gmt":"2024-01-07T03:35:36","slug":"acm2004d","status":"publish","type":"post","link":"https:\/\/kats-eye.net\/info\/2024\/01\/04\/acm2004d\/","title":{"rendered":"ARUDUINO\u3067\uff29\uff12\uff23\u63a5\u7d9a\uff2c\uff23\uff24\u3092\u4f7f\u3046\u2461"},"content":{"rendered":"\n<h2>\u6982\u8981<\/h2>\n\n\n\n<p>\u3000\u79cb\u6708\u96fb\u5b50\u901a\u5546\u8ca9\u58f2\u306e\uff2c\uff23\uff24\uff08\uff12\uff10\u00d7\uff14\u884c\uff09\u3092\u4f7f\u3044\u307e\u3059\u3002<br>\u3000\u63a5\u7d9a\u306f\u4e0b\u56f3\u306e\u901a\u308a\u3067\u3059\u3002\u524d\u6295\u7a3f\u3067\u4f7f\u7528\u3057\u305f\uff2c\uff23\uff24\uff08<em>\uff11\uff16\u00d7\uff12\u884c<\/em>\uff09\u3068\u4f7f\u3044\u65b9\u306f\u3001\u307b\u307c\u540c\u3058\u3067\u3059\u304c\u3001\u5e7e\u5206\u30b3\u30de\u30f3\u30c9\u7b49\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" width=\"549\" height=\"323\" src=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/301.png\" alt=\"\" class=\"wp-image-6354\" srcset=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/301.png 549w, https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/301-300x177.png 300w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><figcaption><em>\uff29\uff12\uff23\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u6db2\u6676\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u3000\uff12\uff10\u6587\u5b57\u00d7\uff14\u884c\u3000<\/em><br><em>\u30d0\u30c3\u30af\u30e9\u30a4\u30c8\u4ed8\u3000\u3000[ACM2004D-FLW-FBW-IIC]<\/em><\/figcaption><\/figure><\/div>\n\n\n\n<h2>\u51fa\u529b\u7d50\u679c\uff08\u8868\u793a\u72b6\u614b\uff09<\/h2>\n\n\n\n<p>\u3000\u51fa\u529b\u7d50\u679c\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/301.jpg\" alt=\"\" class=\"wp-image-6351\" width=\"413\" height=\"252\" srcset=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/301.jpg 877w, https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/301-300x184.jpg 300w, https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/301-768x470.jpg 768w\" sizes=\"(max-width: 413px) 100vw, 413px\" \/><figcaption><em>\uff1c\uff11\u3064\u306e\u6587\u5b57\u5217\u3092\uff14\u884c\u306b\u5206\u5272\u3057\u3066\u51fa\u529b\uff1e<\/em><br><\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/302.jpg\" alt=\"\" class=\"wp-image-6352\" width=\"415\" height=\"249\" srcset=\"https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/302.jpg 869w, https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/302-300x181.jpg 300w, https:\/\/kats-eye.net\/info\/wp-content\/uploads\/2024\/01\/302-768x462.jpg 768w\" sizes=\"(max-width: 415px) 100vw, 415px\" \/><figcaption><em>\uff1c\uff14\u3064\u306e\u6587\u5b57\u5217\u3092\u305d\u308c\u305e\u308c\u884c\u3092\u5206\u3051\u3066\u8868\u793a\uff1e<\/em><br><\/figcaption><\/figure><\/div>\n\n\n\n<h2>\u30d7\u30ed\u30b0\u30e9\u30e0<\/h2>\n\n\n\n<p>\u3000\uff12\u3064\u306e\u8868\u793a\u30d1\u30bf\u30fc\u30f3\u3092\uff13\u79d2\u6bce\u306b\u5207\u308a\u63db\u3048\u8868\u793a\u3059\u308b\u3082\u306e\u3067\u3059\u3002<br>\u3000\u5148\u56de\u306eLCD<em>[ACM1602NI-FLW-FBW-M01]<\/em>\u3082I2C\u63a5\u7d9a\u3057\u3001\uff12\u3064\u306eLCD\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-c\" data-file=\"ACM1602NI-FLW-FBW-M01_MDFY02.ino\" data-lang=\"C\"><code>#include &lt;Wire.h&gt;\nconst uint8_t dvs_adrs[] = { 0x50 , 0x3F };   \/\/ DVS1,DVS2\n\nchar str1[] = {&quot;Don&#39;t hesitate to ask for help.&quot;};\nchar str2[] = {&quot;New Yorkers like it all, which means I have to be ready to do it all.&quot;};\nchar* str_ary1[]={ &quot;How&#39;s it going?&quot;, &quot;It&#39;s going well.&quot; };\nchar* str_ary2[]={&quot;ACM1602NI-FLW-FBW-M1&quot;, \n                  &quot;P-05693 @1700-&quot; ,\n                  &quot;85x33.5x13.5mm&quot;,\n                  &quot;16charx2line&quot;\n                  };\nchar* str_ary3[]={&quot;ACM2004D-FLW-FBW-IIC&quot;, \n                  &quot;P-17381 @1480-&quot; ,\n                  &quot;98x60x14.2mm&quot;,\n                  &quot;20charx4line&quot;\n                  };\nbyte blk = 0x20 ;                             \/\/ \u30b9\u30da\u30fc\u30b9\n\n\/\/ \u521d\u671f\u8a2d\u5b9a\nvoid setup() {\n  Wire.begin(); \/\/ join i2c bus (address optional for master)\n  pinMode(SDA, INPUT);                        \/\/ I2C\u5185\u90e8\u30d7\u30eb\u30a2\u30c3\u30d7\u7121\u52b9\u5316\n  pinMode(SCL, INPUT);                        \/\/ I2C\u5185\u90e8\u30d7\u30eb\u30a2\u30c3\u30d7\u7121\u52b9\u5316\n  lcdinit(0);                                 \/\/ LCD\u521d\u671f\u5316(DVS1)\n  lcdinit(1);                                 \/\/ LCD\u521d\u671f\u5316(DVS2)\n}\n\n\/\/ \u30e1\u30a4\u30f3\u51e6\u7406\nvoid loop() {\n  transDataToLcd( 0 , 0 , 0x01 , 10);         \/\/ \u753b\u9762\u6d88\u53bb(DVS1)\n  transDataToLcd( 1 , 0 , 0x01 , 10);         \/\/ \u753b\u9762\u6d88\u53bb(DVS2)\n  \n  lcd_Disp_Str(0 , str1);                     \/\/ \u6587\u5b57\u8868\u793a(DVS1)\n\n  lcd_Disp_Str(1 , str2);                     \/\/ \u6587\u5b57\u8868\u793a(DVS2)\n\n\/\/  for (int i = 0; i &lt; 4; i++){              \/\/ \u6587\u5b57\u8868\u793a(DVS2)\n\/\/    char* tmp = str_ary2[i];\n\/\/    lcd_DispStrAry( 1, tmp , i );\n\/\/  }\n  delay(3000);\n\n  transDataToLcd( 0 , 0 , 0x01 , 10);         \/\/ \u753b\u9762\u6d88\u53bb(DVS1)\n  transDataToLcd( 1 , 0 , 0x01 , 10);         \/\/ \u753b\u9762\u6d88\u53bb(DVS2)\n  \n  for (int i = 0; i &lt; 2; i++){                \/\/ \u6587\u5b57\u8868\u793a(DVS1)\n    char* tmp = str_ary1[i];\n    lcd_DispStrAry( 0, tmp , i );\n  }\n\n  for (int i = 0; i &lt; 4; i++){                \/\/ \u6587\u5b57\u8868\u793a(DVS2)\n    char* tmp = str_ary3[i];\n    lcd_DispStrAry( 1, tmp , i );\n  } \n  delay(3000);\n}\n\n\/\/ \u6587\u5b57\u8868\u793a\uff11\uff08\uff11\u6587\u3092\u8907\u6570\u884c\u306b\u5206\u3051\u3066\u8868\u793a\uff09\n\/\/ dvs_no(0\uff1aDVS1\u3001 1\uff1aDVS2)\nvoid lcd_Disp_Str(int dvs_no , char* str){\n  int l_cnt = 16 ;\n  int ln_cn = 2 ;\n  if(dvs_no!=0){ \n    l_cnt = 20 ; \n    ln_cn = 4 ;\n  }\n  \n  for(int j = 0; j &lt; ln_cn ; j++){\n    pos_cursor( dvs_no , j , 0);              \/\/\u5ea7\u6a19\u6307\u5b9a\n    for(int i = 0;i &lt; l_cnt ;i++){\n      if(*str == &#39;\\0&#39;){\n        transDataToLcd( dvs_no , 1 , blk , 0);\n      }else{\n        transDataToLcd( dvs_no , 1 , *str++ , 0);\n      } \n    }\n  }\n}\n\n\/\/ \u6587\u5b57\u8868\u793a\uff12\uff08\uff11\u6587\u3092\u5404\u884c\u306b\u8868\u793a\uff09\n\/\/ dvs_no(0\uff1aDVS1\u3001 1\uff1aDVS2)\nvoid lcd_DispStrAry(int dvs_no , char* str , int l_n ){\n    int l_cnt = 16 ;\n    if(dvs_no!=0){ l_cnt = 20 ; }\n    \n    pos_cursor( dvs_no , l_n , 0);            \/\/\u5ea7\u6a19\u6307\u5b9a\n    for(int i = 0 ; i &lt; l_cnt ; i++){\n      if(*str == &#39;\\0&#39;){\n        transDataToLcd( dvs_no , 1 , blk , 0);\n      }else{\n        transDataToLcd( dvs_no , 1 , *str++ , 0);\n      } \n    }\n}\n\n\n\/\/ LCD\u521d\u671f\u5316\n\/\/ dvs_no(0\uff1aDVS1\u3001 1\uff1aDVS2)\nvoid lcdinit(int dvs_no) {\n  if(dvs_no == 0){\n    transDataToLcd( 0 , 0 , 0x01 , 10);      \/\/\u753b\u9762\u6d88\u53bb\n    transDataToLcd( 0 , 0 , 0x38 , 10);      \/\/\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u8a2d\u5b9a\n    \/\/transDataToLcd( 0 , 0 , 0x0F , 10);    \/\/\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\uff2f\uff2e\u3001CURSOR-ON\u3001blinking-ON\n    transDataToLcd( 0 , 0 , 0x0C , 10);      \/\/\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\uff2f\uff2e\u3001CURSOR-OFF\u3001blinking-OFF\n    transDataToLcd( 0 , 0 , 0x06 , 10);      \/\/\u30c7\u30fc\u30bf\u66f8\u304d\u8fbc\u307f\u5f8c\u30a2\u30c9\u30ec\u30b9\u52a0\u7b97\u30e2\u30fc\u30c9\u8a2d\u5b9a\n  } else {\n    transDataToLcd( 1 , 0 , 0x01 , 10);      \/\/\u753b\u9762\u6d88\u53bb\n    transDataToLcd( 1 , 0 , 0x38 , 10);      \/\/\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u8a2d\u5b9a\n    \/\/transDataToLcd( 1 , 0 , 0x0F , 10);    \/\/\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\uff2f\uff2e\u3001CURSOR-ON\u3001blinking-ON\n    transDataToLcd( 1 , 0 , 0x0C , 10);      \/\/\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\uff2f\uff2e\u3001CURSOR-OFF\u3001blinking-OFF\n    transDataToLcd( 1 , 0 , 0x06 , 10);      \/\/\u30c7\u30fc\u30bf\u66f8\u304d\u8fbc\u307f\u5f8c\u30a2\u30c9\u30ec\u30b9\u52a0\u7b97\u30e2\u30fc\u30c9\u8a2d\u5b9a\n  }\n}\n\n\/\/ LCD\u30c7\u30fc\u30bf\u9001\u4fe1\n\/\/ dvs_no(0\uff1aDVS1\u3001 1\uff1aDVS2)\n\/\/ typ_d ( 0:\uff7a\uff8f\uff9d\uff84\uff9e\u30011:\uff83\uff9e\uff70\uff80 )\n\/\/ trsDat( \uff7a\uff8f\uff9d\uff84\uff9e\u3001\u3082\u3057\u304f\u306f\uff83\uff9e\uff70\uff80 )\n\/\/ dTime ( \uff83\uff9e\uff70\uff80\u9001\u4fe1\u5f8c\u3001\u5f85\u6a5f\u6642\u9593 )\nvoid transDataToLcd(int dvs_no , int typ_d , byte trsDat , int dTime){\n  byte typCmd = 0x00 ;\n  if(typ_d != 0){ \n    if(dvs_no == 0){ typCmd = 0x80 ; }\n    else{ typCmd = 0x40 ; } \n  }\n  \n  Wire.beginTransmission(dvs_adrs[dvs_no]);\n  Wire.write(typCmd);\n  Wire.write(trsDat);                   \n  Wire.endTransmission();\n  if(dTime&gt;0){ delay(dTime); }\n}\n\n\/\/ \u8868\u793a\u4f4d\u7f6e\u6307\u5b9a\uff08\u30ab\u30fc\u30bd\u30eb\u5ea7\u6a19\u6307\u5b9a\uff09\n\/\/ dvs_no\uff080\uff1aDVS1\u3001 1\uff1aDVS2)\n\/\/ loc_x \uff080\uff1a1\u884c\u76ee\u30011\uff1a2\u884c\u76ee)\n\/\/ loc_y \uff080\uff1a\u6700\u5de6\u300115\uff1a\u518d\u53f3)\nvoid pos_cursor(int dvs_no , int loc_x , int loc_y){\n  byte p_inf = 0x80 + loc_y;\n  if(loc_x == 1){ p_inf = 0x80 + 0x40 + loc_y; }\n  else if(loc_x == 2){ p_inf = 0x80 + 0x14 + loc_y; }\n  else if(loc_x == 3){ p_inf = 0x80 + 0x54 + loc_y; }\n  \n  transDataToLcd( dvs_no , 0 , p_inf , 5);    \n}<\/code><\/pre><\/div>\n\n\n\n<h2>\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u3000\u79cb\u6708\u96fb\u5b50\u901a\u5546\u306b\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u3042\u308a\u3001\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 \u3000\u79cb\u6708\u96fb\u5b50\u901a\u5546\u8ca9\u58f2\u306e\uff2c\uff23\uff24\uff08\uff12\uff10\u00d7\uff14\u884c\uff09\u3092\u4f7f\u3044\u307e\u3059\u3002\u3000\u63a5\u7d9a\u306f\u4e0b\u56f3\u306e\u901a\u308a\u3067\u3059\u3002\u524d\u6295\u7a3f\u3067\u4f7f\u7528\u3057\u305f\uff2c\uff23\uff24\uff08\uff11\uff16\u00d7\uff12\u884c\uff09\u3068\u4f7f\u3044\u65b9\u306f\u3001\u307b\u307c\u540c\u3058\u3067\u3059\u304c\u3001\u5e7e\u5206\u30b3\u30de\u30f3\u30c9\u7b49\u304c\u7570\u306a\u308a\u307e\u3059\u3002 \u51fa\u529b\u7d50\u679c\uff08\u8868\u793a\u72b6\u614b\uff09 \u3000\u51fa\u529b\u7d50\u679c\u3067\u3059\u3002 \u30d7\u30ed &hellip; <a href=\"https:\/\/kats-eye.net\/info\/2024\/01\/04\/acm2004d\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">ARUDUINO\u3067\uff29\uff12\uff23\u63a5\u7d9a\uff2c\uff23\uff24\u3092\u4f7f\u3046\u2461<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":6351,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[16,22],"_links":{"self":[{"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/posts\/6346"}],"collection":[{"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/comments?post=6346"}],"version-history":[{"count":5,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/posts\/6346\/revisions"}],"predecessor-version":[{"id":6356,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/posts\/6346\/revisions\/6356"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/media\/6351"}],"wp:attachment":[{"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/media?parent=6346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/categories?post=6346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kats-eye.net\/info\/wp-json\/wp\/v2\/tags?post=6346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}