{"id":4548,"date":"2017-06-29T12:00:00","date_gmt":"2017-06-29T03:00:00","guid":{"rendered":"http:\/\/www.nanghi.net\/?p=4548"},"modified":"2023-11-08T21:14:56","modified_gmt":"2023-11-08T12:14:56","slug":"i2c-lcd_if","status":"publish","type":"post","link":"https:\/\/www.nanghi.net\/?p=4548","title":{"rendered":"I<sup>2<\/sup>C-LCD I\/F"},"content":{"rendered":"<p><style type=\"text\/css\">\n<!-- pre { background-color: #F9F9F9; border: 1px solid #DDD; color: black; padding: 1em; font-size: 75%; font-family: Courier, 'MS Gothic', monospace; } .tx_reserve {color: orange;} --><br \/>\n<\/style>\n<\/p>\n<p>\u3000\u6fc0\u5b89\u30e2\u30b8\u30e5\u30fc\u30eb\u30c8\u30e9\u30a4\u30a2\u30eb\u306e\u7d9a\u304d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18385\" src=\"https:\/\/www.nanghi.net\/wp-content\/uploads\/2017\/06\/2017061301.jpg\" alt=\"IIC\/I2C\/TWI\/SPI \u30b7\u30ea\u30a2\u30eb\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u30dc\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\" width=\"400\" height=\"300\" srcset=\"https:\/\/www.nanghi.net\/wp-content\/uploads\/2017\/06\/2017061301.jpg 400w, https:\/\/www.nanghi.net\/wp-content\/uploads\/2017\/06\/2017061301-200x150.jpg 200w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p><strong>\u3000IIC\/I<sup>2<\/sup>C\/TWI\/SPI \u30b7\u30ea\u30a2\u30eb\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u30dc\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb<\/strong><\/p>\n<p>\u3000\u6fc0\u5b89\u4e2d\u83ef\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u3061\u3087\u308d\u3061\u3087\u308d\u3068\u8cb7\u3044\u8fbc\u3093\u3067\u8abf\u3079\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3000\u30ad\u30e3\u30e9\u30af\u30bfLCD\u8868\u793a\u5668\u306f\u4fbf\u5229\u306a\u305f\u3081\u983b\u7e41\u306b\u4f7f\u7528\u3059\u308b\u306e\u3067\u3059\u304c\u30014bit\u30d1\u30e9\u30ec\u30eb\u30e2\u30fc\u30c9\u3067\u4f7f\u7528\u3057\u3066\u3082\u914d\u7dda\u6570\u304c\u591a\u304f\u3066\u5236\u5fa1\u7dda\u306e\u64cd\u4f5c\u3082\u3051\u3063\u3053\u3046\u9762\u5012\u3002\u81ea\u5206\u7528\u306b\u521d\u671f\u5316\u304b\u3089\u8868\u793a\u306a\u3069\u30b3\u30de\u30f3\u30c9\u985e\u3092\u542b\u3081\u305f\u4e00\u9023\u306e\u64cd\u4f5c\u3092\u30e9\u30a4\u30d6\u30e9\u30ea\u5316\u3092\u3057\u305f\u3082\u306e\u3092\u4f5c\u6210\u3057\u3066\u3042\u308a\u307e\u3059\u304c\u3001\u305f\u307e\u306b\u306fArduino\u3092\u30d9\u30fc\u30b9\u306b\u3057\u3066\u4e16\u306e\u4e2d\u306e\u8ce2\u3044\u4eba\u304c\u4f5c\u3063\u3066\u304f\u308c\u305f\u80cc\u4e2d\u306b\u4e57\u3063\u3066\u3057\u307e\u304a\u3046\u3068\u5b89\u6613\u306a\u65b9\u5411\u3078\u6d41\u3055\u308c\u307e\u3057\u305f\uff08\u7b11\uff09\u3002\u30d1\u30e9\u30ec\u30eb4bit\u63a5\u7d9a\u3067\u306f\u306a\u304fI<sup>2<\/sup>C\u3067\u63a5\u7d9a\u3057\u305fLCD\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u306e\u5229\u7528\u3067\u3059\u3002<\/p>\n<p>\u3000NXP\u30bb\u30df\u30b3\u30f3\u30c0\u30af\u30bf\u306eI<sup>2<\/sup>C 8bit I\/O\u30a8\u30af\u30b9\u30d1\u30f3\u30c0PCF8574A\u3092\u642d\u8f09\u3057\u305fLCD\u30e2\u30b8\u30e5\u30fc\u30eb\u5411\u3051\u306eI<sup>2<\/sup>C\u5236\u5fa1\u30e2\u30b8\u30e5\u30fc\u30eb\u57fa\u677f\u3002<br \/>\n\u3000\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30c7\u30d0\u30a4\u30b9\u30c7\u30d5\u30a9\u30eb\u30c8\u30a2\u30c9\u30ec\u30b9\u306f\u30a2\u30c9\u30ec\u30b9\u8a2d\u5b9a\u30d4\u30f3A0\u301cA2\u304c10k\u03a9\u3067\u30d7\u30eb\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u30670x3F\u3068\u306a\u308a\u307e\u3059\u304c\u57fa\u677f\u4e0a\u306e\u30d1\u30bf\u30fc\u30f3\u306bA0\/A1\/A2\u306e\u30b7\u30e7\u30fc\u30c8\u7528\u30d1\u30bf\u30fc\u30f3\u304c\u51fa\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3053\u3053\u306b0\u03a9\u306e\u30c1\u30c3\u30d7\u62b5\u6297\u3092\u5b9f\u88c5\u304b\u30b7\u30e7\u30fc\u30c8\u3059\u308c\u30700x38\u301c0x3F\u306e\u7bc4\u56f2\u306e\u4efb\u610f\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u5225\u3005\u306b\u3059\u308b\u3053\u3068\u3067\u6700\u59278\u53f0\u306e\u30ad\u30e3\u30e9\u30af\u30bfLCD\u8868\u793a\u5668\u3092I<sup>2<\/sup>C\u30d0\u30b9\u4e0a\u306b\u63a5\u7d9a\u3067\u304d\u307e\u3059<\/p>\n<p>\u3000\u3053\u3053\u3067\u306f\u81ea\u524d\u306eLCD\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u308f\u305a\u306bmarcoschwartz\u3055\u3093\u306e\u4f5c\u6210\u3057\u305f<a href=\"https:\/\/github.com\/marcoschwartz\/LiquidCrystal_I2C\" target=\"_blank\" rel=\"noopener\">LiquidCrystal_I2C\u30e9\u30a4\u30d6\u30e9\u30ea<\/a>\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3000\u4f7f\u3044\u65b9\u306f\u81f3\u6975\u7c21\u5358\u3067<\/p>\n<pre>#inlcude &lt;<span class=\"tx_reserve\">LiquidCrystal_I2C<\/span>.h&gt;\r\n\/\/ lcd(address, col_num, row_num)\r\n<span class=\"tx_reserve\">LiquidCrystal_I2C<\/span> lcd(0x3F, 16, 2);\r\nvoid <span class=\"tx_reserve\">setup<\/span>() {\r\nlcd.init();\r\nlcd.backlight();\r\nlcd.setCursor(0, 0);\r\nlcd.print(\"Hello, world!\");\r\nlcd.setCursor(0, 1);\r\nlcd.print(\"Arduino Uno R3\");\r\n}\r\nvoid <span class=\"tx_reserve\">loop<\/span>() {\r\n}<\/pre>\n<p>\u3000\u3068\u8a18\u8ff0\u3059\u308b\u3060\u3051\u3067\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3000\u3068\u308a\u3042\u3048\u305a\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u52d5\u4f5c\u78ba\u8a8d\u3092\u624b\u6301\u3061\u306eArduino Uno R3\u3092\u4f7f\u3063\u3066\u884c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3000\u52d5\u4f5c\u78ba\u8a8d\u30b5\u30f3\u30d7\u30eb\u306a\u306e\u3067\u6a2a\u7740\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u306f\u521d\u671f\u5316\u90e8\u5206\u3060\u3051\u3092startup()\u306b\u8a18\u8ff0\u3057\u3066\u5b9f\u969b\u306e\u8868\u793a\u5468\u308a\u64cd\u4f5c\u306floop()\u3084\u305d\u306e\u4e2d\u304b\u3089\u547c\u3073\u51fa\u3055\u308c\u308b\u95a2\u6570\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30e1\u30c3\u30bd\u30c9\u306b\u306fHD44780\u4e92\u63db\u30c7\u30d0\u30a4\u30b9\u306e\u5236\u5fa1\u306b\u4f7f\u3046\u3082\u306e\u304c\u8c4a\u5bcc\u306b\u3042\u3063\u3066\u3001CGRAM\u306b\u30aa\u30ea\u30b8\u30ca\u30eb\u30ad\u30e3\u30e9\u30af\u30bf\u3092\u66f8\u8fbc\u3080\u30e1\u30bd\u30c3\u30c9\u3082\u7528\u610f\u3055\u308c\u3066\u304a\u308a\u5927\u5909\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<p>\u3000\u3053\u306e\u5b50\u57fa\u677f\u3092LCD\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u57fa\u677f\u80cc\u9762\u306b\u5b9f\u88c5\u3059\u308b\u5834\u5408\u3001\u3053\u306e\u5b50\u57fa\u677f\u306e\u88cf\u5074\u306e\u90e8\u54c1\u3068LCD\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u88cf\u5074\u306e\u90e8\u54c1\u304c\u5e72\u6e09\u3057\u3066\u63a5\u89e6\u3059\u308b\u5fae\u5999\u306a\u8ddd\u96e2\u306b\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u4e88\u3081\u30ab\u30d7\u30c8\u30f3\u30c6\u30fc\u30d7\u306a\u3069\u3067\u8986\u3063\u3066\u7d76\u7e01\u3092\u884c\u3046\u304b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u5b50\u57fa\u677f\u306e\u30b3\u30cd\u30af\u30bf\u3092\u30cf\u30f3\u30c0\u4ed8\u3051\u3059\u308b\u969b\u306b\u5341\u5206\u306a\u9699\u9593\u3092\u3042\u3051\u3066\u5b9f\u88c5\u3057\u3066\u3001\u9699\u9593\u3092\u78ba\u4fdd\u3059\u308b\u30b9\u30da\u30fc\u30b5\u30fc\u3092\u631f\u3080\u306a\u3069\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u65b9\u304c\u5f8c\u3005\u306e\u30c8\u30e9\u30d6\u30eb\u306b\u306a\u3089\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3000\u203b \u642d\u8f09\u3057\u3066\u3044\u308b\u30c7\u30d0\u30a4\u30b9\u304cPCF8574\u306e\u5834\u5408\u3068PCF8574<strong style=\"color: red;\">A<\/strong>\u306e\u5834\u5408\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002\u4e2d\u83ef\u306a\u88fd\u54c1\u306e\u5834\u5408\u3001\u5e73\u6c17\u3067\u8abf\u9054\u306e\u72b6\u6cc1\u304b\u306a\u306b\u304b\u3067\u52dd\u624b\u306b\u4ed5\u69d8\u5909\u66f4\u3057\u3066\u51fa\u3066\u304d\u307e\u3059\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\uff11\u30ed\u30c3\u30c8\u4e2d\u3067\u3042\u3063\u3066\u3082\u5909\u66f4\u304c\u5165\u308b\u4f8b\u3092\u898b\u3066\u304d\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u306e\u3067&#8230;\u3002<br \/>\n\u3000\u79c1\u306e\u5165\u624b\u3057\u305f\u7269\u3067\u306fPC8547A\u3067\u3057\u305f\u304c\u3001\u3082\u3057PCF8574\uff08A\u306a\u3057\uff09\u306e\u5834\u5408\u306f\u3001I<sup>2<\/sup>C\u306e\u30c7\u30d0\u30a4\u30b9\u30a2\u30c9\u30ec\u30b9\u304c\u30c7\u30d5\u30a9\u30eb\u30c80x27\u3001\u30a2\u30c9\u30ec\u30b9\u8a2d\u5b9a\u7bc4\u56f2\u306f0x20\u301c0x27\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u6fc0\u5b89\u30e2\u30b8\u30e5\u30fc\u30eb\u30c8\u30e9\u30a4\u30a2\u30eb\u306e\u7d9a\u304d\u3002 \u3000IIC\/I2C\/TWI\/SPI \u30b7\u30ea\u30a2\u30eb\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u30dc\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb \u3000\u6fc0\u5b89\u4e2d\u83ef\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u3061\u3087\u308d\u3061\u3087\u308d\u3068\u8cb7\u3044\u8fbc\u3093\u3067\u8abf\u3079\u3066\u3044\u307e\u3059\u3002 \u3000\u30ad\u30e3\u30e9\u30af\u30bfLCD\u8868\u793a\u5668\u306f\u4fbf\u5229\u306a\u305f\u3081\u983b\u7e41\u306b\u4f7f\u7528<\/p>\n","protected":false},"author":1,"featured_media":18385,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5213],"tags":[1650,1487,3730],"class_list":["post-4548","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-device","tag-arduino","tag-i2c","tag-lcd"],"_links":{"self":[{"href":"https:\/\/www.nanghi.net\/index.php?rest_route=\/wp\/v2\/posts\/4548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nanghi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nanghi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nanghi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nanghi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4548"}],"version-history":[{"count":6,"href":"https:\/\/www.nanghi.net\/index.php?rest_route=\/wp\/v2\/posts\/4548\/revisions"}],"predecessor-version":[{"id":22925,"href":"https:\/\/www.nanghi.net\/index.php?rest_route=\/wp\/v2\/posts\/4548\/revisions\/22925"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nanghi.net\/index.php?rest_route=\/wp\/v2\/media\/18385"}],"wp:attachment":[{"href":"https:\/\/www.nanghi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nanghi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nanghi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}